#help-development

1 messages · Page 1846 of 1

mighty sparrow
#

++ increments after

tardy delta
#

i thought there was no difference unless you're using it in a method

ivory sleet
#

Yeah precisely

mighty sparrow
#

array[++i]

#

its useful in c# to do in one statement

#

instead of i++

ivory sleet
#

If you just have i++ it wouldn’t matter if you’d rather use ++i

mighty sparrow
#

array[i]

ivory sleet
tardy delta
#

if you'd do this.a++ it would have the same result?

ivory sleet
#

Yes

mighty sparrow
#

yes

tardy delta
#

bruh

mighty sparrow
#

if you did it in a condition or in an instruction, there would be the utility

#

you'd see the difference

tardy delta
#

post increment looks cleaner

mighty sparrow
#

do a system.out.print(++i)

#

do a system.out.print(i++)

tender shard
#

yeah why not also rewrite whole spigot etc

#

I don't see any advantage in rewriting what already exists

ivory sleet
#

Let’s rewrite Java 🌝

tardy delta
#

if i = 3 then it will print 4 and 3

#

Dreamy32

tender shard
tardy delta
ivory sleet
mighty sparrow
#

spigot is a fork of craftbukkit no

mellow gulch
ivory sleet
tardy delta
#

elf on the shelf

#

heh

mighty sparrow
#

instead of doing a spigot fork

#

do a brand new craftbukkit fork

#

even better

ivory sleet
mighty sparrow
#

be the main fork

buoyant viper
#

hmm

ancient plank
#

or rewrite bukkit to get rid of those 10 year old code blunders
fork vanilla

tardy delta
mellow gulch
#

hmm, weird

tardy delta
#

nothing weird 😂

mellow gulch
#

i=3;
++i; //i is 4 now
i++; //somehow i is now 3?

tardy delta
#

but bruhh reset it back to 3

#

rawr

mellow gulch
#

oh lol, didn't know you reset it inbetween

ivory sleet
#

FourteenBrush I can’t tell if you’re just using some odd jvm implementation

#

Oh nvm

mellow gulch
mighty sparrow
#

how would we call our fork

tender shard
mighty sparrow
#

omg

#

thats such an odd name

tender shard
#

yeah lmao

mighty sparrow
#

is odd means cool

tender shard
#

but it's basically the same as a spigot

mighty sparrow
#

what does it mean lol

tender shard
#

like spigot

mighty sparrow
#

sPIgOT

tender shard
#

no

ivory sleet
tender shard
#

sIlLc0cK

tardy delta
#

ah i resetted to value

#

to see the difference between the to statements

mellow gulch
mighty sparrow
#

oh

cold pawn
#

How can I get a player, that another player is looking at?

mighty sparrow
#

i thought sillcock was sus

#

my english man

tender shard
#

there's no "getEntityPlayerIsLookingAt"

mighty sparrow
tender shard
#

yeah, get nearby entities, apply some vector magic and .... then redo everything because it doesn't work a few times, and done :3

mighty sparrow
#

with f3, you can see a redline where the player looks at

#

is there a way to get those infos with a getRedLine

#

something like that

tender shard
#

no

#

but it's basically just a vector starting from your eyeline to the direction where you're looking

#

so: easy to replicate

mighty sparrow
#

in vanilla you can teleport a player by modifying his head position

#

if we can set, we can get

cold pawn
fleet imp
#

say I have

option1: abcd
option2: 1234

how do I get option2 specifically

tardy delta
#

int i = config.getInt("option2")

chrome beacon
tardy delta
#

writing abcd there without " " will cause an exception i guess

gleaming grove
#

Hello it is possible remove color code after player use colored tabComplete argument?

chrome beacon
#

Don't put colors in the tabComplete like that

gleaming grove
#

so how can i achieve colors in tabComplete?

chrome beacon
#

if you want to mimic the coloring of vanilla commands use the Brigadier library

gleaming grove
#

ok

halcyon shuttle
#

guys quick question- if ive got spigot 1.18.1 do i need to install buildtools as well?

chrome beacon
#

No you use BuildTools to get Spigot

halcyon shuttle
#

oh

#

so i should use build tools instead of spigot 1.18.jar?

chrome beacon
#

No BuildTools will make the 1.18 spigot jar

#

Where ever you got your jar from it's not official

halcyon shuttle
#

yea so ill use that instead of installing manually spigot only like i did

halcyon shuttle
#

anyhow thanks for help

chrome beacon
#

You're not on an official site

mellow gulch
#

you aren't supposed to download spigot from anywhere, if you downloaded it from some website, stop using it, it could have malicious code.
you download buildtools from spigotmc and run it, it will build spigot

halcyon shuttle
chrome beacon
#

That gets you to BuildTools

halcyon shuttle
#

basicly at the same place got buildtools from

chrome beacon
#

Not a Spigot jar download

halcyon shuttle
#

anyhow imma just use them rn thanks for help

halcyon shuttle
chrome beacon
#

There isn't

mellow gulch
chrome beacon
#

oh and if link is auto deleted it's not an official site

halcyon shuttle
#

okay lemme just find it real quick

#

u guys were right, it was not on spigots site

#

my bad

quaint mantle
#

Help

val userV = ProxyServer.getInstance().getPlayer(v2)?: return player.sendMessage(*ComponentBuilder(("§cPlayer não encontrado")).create())
                        userV.sendMessage(*ComponentBuilder (" ").color(ChatColor.RED).create())
                        
                        userV.sendMessage(*ComponentBuilder ("§aVocê recebeu uma solicitação de amizade de ${player.name}").create())
                        var aceitar = TextComponent("§a§lAQUI")
                        var negar = TextComponent("§c§lAQUI")

                        aceitar.clickEvent = ClickEvent(ClickEvent.Action.RUN_COMMAND, "/amigos aceitar ${player.name}")
                        negar.clickEvent = ClickEvent(ClickEvent.Action.RUN_COMMAND, "/amigos negar ${player.name}")

                        aceitar.hoverEvent = HoverEvent(
                            HoverEvent.Action.SHOW_TEXT,
                            ComponentBuilder("/amigos aceitar ${player.name}").create()
                        )
                        negar.hoverEvent = HoverEvent(
                            HoverEvent.Action.SHOW_TEXT,
                            ComponentBuilder("/amigos negar ${player.name}").create()
                        )


                        userV.sendMessage(*ComponentBuilder("§aClique ${aceitar}§a para aceitar e ${negar}§a para negar.").create())
                        userV.sendMessage(*ComponentBuilder(" ").create())```
mellow gulch
#

np, also you should run /version from time to time, spigot updates often

mellow gulch
halcyon shuttle
#

it says its fine for now but ill be checking it

fast onyx
#

Hi, I'm having a error, this is the code

    public static boolean hasFullIron(Player player) {
        ItemStack[] armorContents = Objects.requireNonNull(player.getEquipment()).getArmorContents();
        if(armorContents.length < 4) {
            return false;
        }
        for (ItemStack armorItem : armorContents) {
            
            if(!armorItem.getType().name().contains("IRON")) {
                return false;
            }
        }
        return true;
    }

And this is the error

#

the line 28 of IronArmor is

#

It was working on 1.8 but not on 1.16

#

I'm missing something that have been changed between versions?

candid galleon
#

It’s a NPE meaning armorItem is probably null

fast onyx
#

Yea because it happens if you don't have armor equipped

candid galleon
#

not sure about API changes in regards to inventory nullability, I thought it was nullable even in 1.8

#

slap a null continue check and you should be fine

mellow gulch
#

things seem to go back and forth between empty slots being air and being null with each version, just check if the armorItem is null before you try to access its members

fast onyx
candid galleon
#

Must be nullable now ¯_(ツ)_/¯

fast onyx
#

Let me change smth

#

thanks in advance

fast onyx
#

and 1.16 air?

#

sorry for the ping btw

chrome beacon
#

I wish Spgiot could be more consistent with null and air

ivory sleet
#

Yeah, air > null

fast onyx
#

RequireNonNull won't work but a condition to check if's null yes?

ivory sleet
#

Yeah

#

Well you do have requireNonNullElse and requireNonNullElseGet

mellow gulch
ivory sleet
quaint mantle
ivory sleet
#

What does that imply?

quaint mantle
#

I needed to implement the TextComponent in the sentence, but this happened

#

'-

ancient plank
#

isn't it Player#spigot()#sendMessage() for sending textcomponents? or am I mistaken

ivory sleet
#

BungeeCord I believe

#

@quaint mantle anyways why do you need to use *?

#

ComponentBuilder::create returns the desired type

quaint mantle
#

kotlin stuff

ivory sleet
#

Hmm I thought you could just pass an array type to a vararg without having to use *

ancient plank
#

who ghost pinged me

quaint mantle
#

you asked if it's that shape, i said i use bungeecord and that's how you do it

torn shuttle
#

wow, only 2701 sonarlint issues

#

google will be giving me a call with a blank check any day now

#

to be fair it takes a very high iq to understand my code

sacred mountain
#
ParticleEffect.ITEM_CRACK.display((ParticleEffect.ParticleData)new ParticleEffect.ItemData(Material.BLACK_WOOL, (byte)0), 0.3F, 0.3F, 0.3F, 0.1F, 10, location, 20.0D);```

any1 know
#

how to change this to 1.8 ID

#

black_wool doesnt exist and i dont know how to change it to 1.8

quaint mantle
zealous osprey
#

Does it matter if you have one main event class or multiple little classes that use the same events ?

candid galleon
#

Prioritization is important but aside from that don’t think it matters

quaint mantle
#

anyone know what causes this error......?

#

I tried the [Help 1] but i got nothing from it

candid galleon
#

You’re targetting Java 5

paper viper
#

lol

candid galleon
#

update to Java 16 bro

paper viper
#

why 16

#

17

candid galleon
#

Java 5 is ancient

#

17 is a bit cutting edge from what I’ve seen

quaint mantle
#

wtf

paper viper
#

Nah its required for 1.18 right?

quaint mantle
candid galleon
#

Guess it does

quaint mantle
paper viper
quaint mantle
#

but if you're devleoping i havent seen any issue

paper viper
#

ur pom doesnt specify it

quaint mantle
#

oh wat

candid galleon
#

You have to change the compiler settings

paper viper
#

XD

wet breach
quaint mantle
#

i fixed it 💀

torn shuttle
#

I understand that using the same string over and over again isn't great but I feel like sonarlint is a bit too strict with it

paper viper
#

are they in different classes

#

lol

#

you could create a constant but it depends on the context of your code

wet breach
#

object re-use is preferred and generally more optimal

torn shuttle
#

I mean the opposite, as in defining the same string over and over again in multiple locations

wet breach
#

oh

#

in that case if its the same probably best to reduce the number then

paper viper
#

make a constant or smthing

torn shuttle
#

I mean yeah sort of

paper viper
#

i guess

torn shuttle
#

I just don't see it as being very practical a lot of the time

wet breach
#

sometimes it isn't

quaint mantle
#

Hey there! When players walk on a tripwire, this triggers a redstone signal. I would like to disable this mechanism. How could I do so?

#

I am already disabling BlocksPhysics and I tried to play with BlockRedstoneEvent but it is not triggered

sacred mountain
#

plugins

#

oh

paper viper
#

Lol

sacred mountain
#

yeah

paper viper
sacred mountain
#

mb

torn shuttle
#

wait this isn't Wendy's?

sacred mountain
#

lmao

paper viper
#

Nope its Burger King

torn shuttle
#

no wonder my fries were taking forever to get here

buoyant viper
#

i thought this was Roy Rogers, where the fuck is my chicken??

quaint mantle
#

Am I in the right channe;?

buoyant viper
#

no

sacred mountain
#

what word does gordon ramsey say the most

quaint mantle
buoyant viper
#

lamb sauce

buoyant viper
sacred mountain
#

this water is burnt

wet breach
quaint mantle
#

So why did you say I am not in the right channel? I am a bit confused

sacred mountain
#

bruh

#

you are in the right channel theyre joking

buoyant viper
#

this is the right channel for spigot plugin dev yes

quaint mantle
#

nice 🥲

#

Should I repost my message?

buoyant viper
#

no

#

unless someone doesnt get to it in like a day

#

ur sure BlockRedstoneEvent isnt getting fired by tripwires?

torn badge
quaint mantle
buoyant viper
#

ah, looks like freq got answer for u

wet breach
#

redstone is a bit finicky to mess with

#

and really not a whole lot of events for it unfortunately

peak granite
#

if i'm making a java plugin can i just have a random kotlin file (apart of the plugin, like an event listener for example) in there, and it'll still work?

buoyant viper
#

as long as u bundle the kotlin runtime

#

or make sure its in the classpath somehow

wet breach
#

is it allowed? sure as long as everything conforms to the rules

buoyant viper
#

kotlin will not run without its runtime included iirc

#

bc kotlin intrinsics

quaint mantle
#

I will try this:

    @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
    public void onPoweringTripwire(final PlayerInteractEvent event) {
        final Block block = event.getClickedBlock();
        if (event.getAction() == Action.PHYSICAL
                && block != null
                && block.getType() == Material.TRIPWIRE) {
            event.setCancelled(true);
        }
    }
peak granite
#

uxon

#

hackedserver dev

quaint mantle
quaint mantle
#

can you give me a link to your message?

buoyant viper
#

maybe its TRIPWIRE_HOOK? idk

peak granite
#

yeah

quaint mantle
quaint mantle
#
    @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
    public void onPoweringTripwire(final PlayerInteractEvent event) {
        final Block block = event.getClickedBlock();
        Bukkit.broadcastMessage("d");
        if (event.getAction() == Action.PHYSICAL
                && block != null
                && block.getType() == Material.TRIPWIRE) {
            Bukkit.broadcastMessage("canceled");
            event.setCancelled(true);
        }
    }
#

I do not see any "d" in the chat when walking into my block

torn badge
#

Is it fired when left/right clicking a block?

quaint mantle
#

is there another way to trigger this event to ensure it is really registered?

#

2 fast 4 me

#

yeah it is

torn badge
#

Is your tripwire hooked?

quaint mantle
#

no it is not

torn badge
#

It needs to be

#

You need to hear the click

quaint mantle
#

But I just want to disable the redstone thing

wet breach
#

you are going to have to get a bit creative with just a tripwire

quaint mantle
#

I'm actually using tripwire variations to "add" new blocks

wet breach
#

ok, well it needs to be variants of tripwire_hooks

#

otherwise again going to need to get creative with the events

quaint mantle
torn badge
#

You will have to go with MoveEvent

quaint mantle
#

the issue is that when I walk on it it gets powered

#

ah shit

#

what would you suggest with move event?

wet breach
#

check if the block above has a tripwire?

#

I mean only ever after to do +1 on the y

quaint mantle
wet breach
#

then do whatever it is you are wanting if a tripwire is there?

#

idk

torn badge
#

Then BlockRedstoneEvent

quaint mantle
#

how could you know if this block used to be unpowered?

quaint mantle
wet breach
#

like I said you are going to have to get creative

quaint mantle
#

Yes this is what I am asking for help here 😛

wet breach
#

there is not unfortunately an easy solution for everything

quaint mantle
#

again, that's why I am asking for help

wet breach
#

I know, but this might not be something you are going to be able to get help on as a whole

torn badge
#

Listen for MoveEvent, when the player steps on a wire save the location somewhere, then listen to BlockRedstoneEvent, check if the current block is connected to that saved location, if yes set the new current to 0

wet breach
#

probably better off getting help in small slices to the over all problem as you encounter the smaller ones

torn badge
#

Are instead of saving the location create a Map with the Player as key and a boolean as value, then set it to true when the player is standing on a wire

quaint mantle
torn badge
#

It is not triggered when a block is being powered?

#

You need to connect a block which can actually be powered for it to fire

quaint mantle
#

you see it is written: powered

#

so my block lost its texture

quaint mantle
#

this is a server side change when you walk on a tripwire, unrelated with hooks

#

it becomes "powered"

#

this is this mechanism that I am trying to disable

torn badge
#

Yeah same thing, you don't even need BlockRedstoneEvent

quaint mantle
#

it's probably easy to disable it from the server source code but I would prefer to do it in a plugin

torn badge
#

Cast the wire's blockdata to Powerable and do setPowered

#

In PlayerMove

ancient plank
#

blockphysicsevent

#

maybe

#

or

#

interact event, check the physical action

#

idk if that triggers if its not connected to hooks tho

karmic bear
#

I have a question, I am writing a plugin with its own economy, warps and ranks and such, but if I have other plugins like EssentialsX for example, with those same features/commands,
how do I tackle compatibility/command overlapping issues? and other issues like permissions/economy

torn shuttle
#

playing whack-a-mole with sonarlint issues is like popping bubble wrap

torn shuttle
ancient plank
torn shuttle
#

i have a class that handles all transactions, all I need to do is change where to read / write from

wet breach
#

anyways, the person keeps asking for help on something that you really can't get help for

#

it is just unfortunate

#

no matter how many times they keep asking the responses for it are simply not going to change XD

karmic bear
torn shuttle
#

I just let people turn my system off for teleports if they want to do their own

karmic bear
#

darn

torn shuttle
#

that's why my config files have thousands of lines lol

quaint mantle
quaint mantle
quaint mantle
crisp forum
#
Object[] asd = event.getBlock().getDrops().toArray();
System.out.println(asd[0]);

gives me ItemStack{COBBLESTONE x 1} how can I get the amount of the cobblestone

wet breach
quaint mantle
wet breach
#

you are going to have to get creative to work around the lack of a solution

quaint mantle
#

I actually don't really know where to start, that's why I am asking for help

wet breach
#

the easiest solution is probably going to be NMS

quaint mantle
#

why?

wet breach
#

because there is no direct API to solve it

#

you are going to have to make use of multiple events

#

with various checks

quaint mantle
wet breach
#

I don't know how to explain it any clearer then that

wide coyote
quaint mantle
#

sorry for caps

wide coyote
wide coyote
candid plover
#

Help, my plugin is registred, and works perfectly economyimpleter from vault

#

but this appears when I download some other plugin that needs a vault

#

[Vault] Economy: null [null] (After using /vault-info)

#
        econ = new EconomyImplementer();
        getPlugin().getServer().getServicesManager().register(Economy.class, econ, this, ServicePriority.Normal);
        console.sendMessage("§aLBEconomy: Vault is working");
    }```
stone sinew
#

Why does
pl.getLogger().warning("DEBUG >> Stream: "+Boolean.valueOf(Arrays.stream(inv.getContents()) == null)); output: false
but
pl.getLogger().warning("DEBUG >> Stream: "+Boolean.valueOf(Arrays.stream(inv.getContents()).findAny() == null)); outputs: NullPointerException?

wet breach
#

probably has to do with the findAny() method

stone sinew
#

.findAny() should just return null if it doesn't exist though.

sacred mountain
#
ParticleEffect.ITEM_CRACK.display((ParticleEffect.ParticleData)new ParticleEffect.ItemData(Material.END_STONE, (byte)0), 0.3F, 0.3F, 0.3F, 0.1F, 6, location, 20.0D);```
#

why does END_STONE

#

not get recognised

#

its in 1.8 item format

stone sinew
sacred mountain
#

1.8.8

#

should work right

stone sinew
#

Should. One sec.

sacred mountain
manic furnace
#

On the Click.Action.CHANGE_PAGE, how can i change the page?

wet breach
#

it will NPE

stone sinew
#

I already have null checks for that

wet breach
#

obviously something before it is null

#

you can't use methods on an object that is null

stone sinew
#

Well look at the message the first one outputs false so the stream isn't null but findAny() throws and NPE

wet breach
#

yes, which leaves me to suspect something about the inventory object is null

stone sinew
#
if(chest == null) return;
Inventory inv = chest.getInventory();

pl.getLogger().warning("DEBUG >> Stream: "+Boolean.valueOf(Arrays.stream(inv.getContents()).findAny().isPresent()));
sacred mountain
#

can anyone help me

wet breach
#

already told you something before findAny() is null then

#

its not magic

stone sinew
wet breach
#

otherwise you wouldn't get an NPE

stone sinew
wet breach
#

Java doesn't throw NPE for stuff that isn't null 😉

sacred mountain
#

ITEM_CRACK has worked for the other effects im making so thats not the problem

stone sinew
#

👍 well Material is red so check for another material?

sacred mountain
quaint mantle
#

my name should be in &7 color, the prefix is there, but its not chaning my names color (I know theres my prefix because when i give myself a group with visible prefix it shows it)

quaint mantle
sacred mountain
#

mk then idk

#

never worked with displaynames

quaint mantle
#

oh wait

#

you gave my a idea

sacred mountain
#

:D

wet breach
#

@stone sinew

for findAny()

Exception : If the element selected is null, NullPointerException is thrown.

stone sinew
wet breach
#

ItemStack[] might not be null, but individual items can be

stone sinew
#

That defeates the purpose of isPresent()

quaint mantle
stone sinew
#

Welp. Ill just use my ugly method from yesterday xD

wet breach
#

not quite the same

sacred mountain
stone sinew
wet breach
#

use whatever, was just telling you why findAny() was throwing an NPE which was my first suggestion, second being something with the inventory

#

and ironically both are correct/related XD

stone sinew
#

👍 thx for the help.

scenic scarab
#

Hello!
I am creating an NPC in 1.18.x.
I want to give it a second layer of skin, is there a good way to do this?
npc.ai().a(new DataWatcherObject<>(16, DataWatcherRegistry.a), (byte)127);
I'm getting an error with
Thanks in advance !!!

chrome beacon
#

Another one

#

Why are so many making their own npcs

#

And you all get stuck on the same step

scenic scarab
#

Citizens are expensive 😫

chrome beacon
#

Citizens is free

#

Read the spigot page 😉

scenic scarab
#

But I want to do it without using the API. Because I'm still a beginner and I want to learn a lot of things

candid plover
#

Can someone help me? My plugin is disabled because there is no vault on my server, but it is.

vague oracle
#

Its almost like we can't help you with no error logs :/

wraith apex
#

lol

vague oracle
#

Does it show on /pl

candid plover
#

It doesn't give any error, it just disables the plugin and says the vault isn't on the server.

wraith apex
#

Some of us don't want to rely on another dev to update their plugin every time a new release comes

chrome beacon
#

Then update or fork things yourself. The problem isn't people making NPCs it's that they have no idea what they're doing

wraith apex
#

Another reason is that not everyone wants to just flat out use API's and not look into how they work

#

some people just want to build NPC stuff themselves

#

because its more fun that way

chrome beacon
wraith apex
#

your source for this?

#

you also have a greater understanding of what is happening

wet breach
#

not everyone needs a large lib for NPC's either

wraith apex
#

^

#

Cit is arguably bloat

chrome beacon
wet breach
#

I am more comfortable coding something myself usually as opposed to relying on some lib as well

wraith apex
#

^

wet breach
#

there are some freedoms you give up when using a lib

wraith apex
#

a lot

#

if you're coding something that breaks the lib because its a weird edge case.. well now you have to contact the dev and he'll probably not care

wet breach
#

Now that isn't to say I am going to advocate people do it themselves, if they really have no idea in what they are doing I do recommend a lib to help them out

wraith apex
#

or you have to reverse engineer

#

I think code snippets are more useful than a lib

#

or at least, the lib but with the source

scenic scarab
wet breach
wraith apex
#

Nice

#

Side note, yeah you can fork citizens

#

but

wet breach
#

whenever I find a piece of code that I found handy I save it 🙂

wraith apex
#

You gotta learn how it all works

#

internally

#

if it breaks, gotta learn how to fix it too

wet breach
#

reason why I have all kinds of projects that I keep around too even if they are super old

wraith apex
#

^

#

yup

#

I have too many methods that I don't want to throw away because I spent hours on them

#

only to find a better way of doing something

wet breach
#

its not that I spent hours but rather they are just nifty lmao

#

and I don't want to forget them because at some point it will come handy

wraith apex
halcyon shuttle
#

guys do i need craftbukkit and spigot for 1.18.1 plugins?

wet breach
#

spigot is technically craftbukkit

#

as its built on top

wraith apex
#

I think craftbukkit is already in the codebase of spigot

wet breach
#

you only need spigot

wraith apex
#

Spigot is Bukkit + CraftBukkit + Spigot stuff

#

all combined

halcyon shuttle
#

because i just finished installing buildtools and some versions have option to install bukkit and spigot jars and some have only spigot

chrome beacon
#

Newer versions don't have craftbukkit jars

wet breach
halcyon shuttle
#

oh okay

wet breach
#

most people don't have a reason to target those things

wraith apex
#

I do hate the change of implementation of 1.18 though

halcyon shuttle
#

thanks for help

chrome beacon
wraith apex
#

why is spigot in Manifest.mf lol

wet breach
wraith apex
#

why are all the libs no longer integrated like they were before

wet breach
#

what libs are you referring to?

halcyon shuttle
#

oh btw if i can ask here- is making plugins on newer versions of mc harder?

sullen marlin
#

read

wraith apex
#

everything is nested inside META-INF

halcyon shuttle
wet breach
wraith apex
#

aight but everything is inside it

#

compared to 1.17 and older

wet breach
#

well yes, because that is how dependencies work

#

We could get in a long conversation about META-INF, but for the most part no one really has a reason to worry about it or care about it

wraith apex
#

So you're expected to use Maven now?

chrome beacon
#

They're talkikg about the fact that Spigot is a bootstrap jar

wet breach
#

No, as I said, its not an essential file

wraith apex
#

ye

wet breach
#

META-INF helps tools like maven itself find dependencies or identify when dependencies are transitive etc

wraith apex
#

the bootstrap stuff

chrome beacon
wet breach
wraith apex
#

wuts all dis then

wet breach
#

Main class file split because of nested classes

sullen marlin
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or use a dependency manager such as Maven or Gradle to handle this automatically.

wraith apex
#

Yes I read that

wet breach
#

I am not entirely sure what it is you are concerned about?

#

or what the issue is

wraith apex
#

So you just throw that into the server but plugin developing wise, you depend on the nested jars

wet breach
#

no...

wraith apex
#

aight I'm lost haha

wet breach
#

the API jar is hosted in spigots maven repo. You can depend on that, proper development is even if the jar you depend on does provide other libs, you should depend on the libs locally yourself. The libs being present in the server is more a convenience to the server operators in not having to go fetch them and for the developer in not having to shade them.

sullen marlin
#

I really did not think this change would cause so much confusion

wraith apex
#

So any lib not spigot related got yeeted from spigot and is now its own jar file you need to reference

wet breach
sullen marlin
#

I mean sure, thats one way of putting it

wraith apex
chrome beacon
torn shuttle
#

why is shading called shading anyway

chrome beacon
#

Or you know just use Maven/Gradle

wraith apex
torn shuttle
#

how dare you

wraith apex
#

which are jars with all the libraries inside them

torn shuttle
#

I know I gained some weight with the xmas food but it's not that bad

wraith apex
#

shaded meaning no libs inside them

#

lmao

wraith apex
#

and then depend on the other libs

#

in the lib folder

#

if you need them?

#

or does spigot need them

halcyon shuttle
#

guys one more thing- im having troubles importing stuff, eclipse just keeps pretending org.bukkit doesnt exist ive written these 3 lines and it highlights JavaPlugin and org.bukkit.java. when im checking on javaplugin its not showing me an option to import it from org.bukkit even tho i think it should package me.Stephen.firstplugin2;

import org.bukkit.java.JavaPlugin;

public class Main extends JavaPlugin {

}
what am i doing wrong?

torn shuttle
#

shading just forces specific class paths right

wraith apex
#

that's shady

sullen marlin
#

well did you add spigot-api as a library

wraith apex
#

I did

sullen marlin
#

talking to stephen

wraith apex
#

oh, sorry

halcyon shuttle
torn shuttle
#

I don't like the term shading, someone call up mr oracle and tell them to rename that term

sullen marlin
#

you cannot depend on spigot-1.18.1.jar

wraith apex
#

someone call up oracle and tell them to stop updating java every 6 months

sullen marlin
#

you need to depend on the API

#

please review the release notes

torn shuttle
#

while you're at it tell mr oracle to find a shorter spelling for boolean

halcyon shuttle
sullen marlin
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar (download), or the contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

wraith apex
#

lol

halcyon shuttle
torn shuttle
sullen marlin
#

replace spigot-1.18.1.jar with Spigot/Spigot-API/target/spigot-api-1.18.1-R0.1-SNAPSHOT-shaded.jar

wraith apex
#

it will devolve into the rust language where all key words are 3 letters long

torn shuttle
#

why assert when you can ass

halcyon shuttle
#

it should be in buildtools folder already, shouldnt it?

sullen marlin
#

yes

wraith apex
torn shuttle
#

I don't need a reason to want to ass

sullen marlin
#

honestly tempted to make buildtools copy the api out as well

torn shuttle
#

yeah was going to say md_5

wraith apex
#

ye

torn shuttle
#

you're just making more work for yourself by not doing that

sullen marlin
#

but then server owners will get confused by spigot-api 😉

torn shuttle
#

also let me go back to my amazing \^-^ username, those were the glory days

wraith apex
#

Java if it had rust like levels of lazyness:

pub sta voi mai(Str arg[])
{
  Ass.fal(tru);
}
torn shuttle
#

package the api in a folder called "developer"

halcyon shuttle
torn shuttle
#

or "developers"

sterile token
#

Using Apache Http is possible to send a post request with json parameters and files?

#

Thanks

wraith apex
#

I mean, I've always used the api to develop and to throw it into the server to run

halcyon shuttle
#

also this might be a really dumb question but why cant i delete spigot.jar file from referenced libraries

#

i mean the delete option is gray

chrome beacon
#

🤷‍♂️ I use Intellij and Maven

sterile token
#

Thanks

wraith apex
#

🤷‍♂️ Eclipse and custom build scripts

sterile token
#

Dont use eclipse pleasee

halcyon shuttle
wraith apex
chrome beacon
olive lance
#

Is the ender pearl item cooldown overlay changeable?

mellow gulch
#

the time delay is

chrome beacon
#

It can also be applied to any item

mellow gulch
#

can put it on non-ender pearl projectiles also

olive lance
#

What is it called?

mellow gulch
#

i forgot, ill check in a bit and let you know if someone else doesn't say before i get back

sullen marlin
#

search the docs for cooldown

#

pretty sure thatll show it

sterile token
#

md_5 how often is the spigot api updated?

buoyant viper
#

hella

olive lance
#

If I listen for projectilelaunchevent and set the cooldown in that it will always happen after the vanilla cooldown tried to set?

#

Or will i need to set the priority

sullen marlin
#

daily-weekly

halcyon shuttle
#

quick question how to make run.exe inside build tools

#

because i really dont want to break anything by doing it wrong

halcyon shuttle
#

oh

#

i mean run.bat

#

sorry

#

idk why i wrote exe

wet breach
#

need to set your view in windows to show file extensions

#

then create a text document

#

rename it to run.bat

#

it will turn it to a bat file

#

you can add what it is you want in the file before or after renaming doesn't matter

halcyon shuttle
wet breach
#

java -Xmx2G -Xms2G (or whatever ram you want to give it or just exclude those entirely) -jar BuildTools.jar

#

this is the minimum

#

you can go fancier if you want

#

not required however

quaint mantle
halcyon shuttle
wet breach
#

I normally just execute BuiltTools from the command line though since nothing special is needed

wet breach
quaint mantle
#

line 39..?

halcyon shuttle
#

thanks for help

wet breach
#

so what that does is if BuildTools Directory doesn't exist, it will make it. Once it is made or identified, it changes the active directory to that buildtools directory. Next it downloads buildtools and then afterwards it pauses and waits for your input on the version you want built which then automatically invokes the command to run buildtools and version you want 🙂

#

as I said you can go fancier if you want it just isn't required

echo basalt
#

I'm facing extremely weird issues

#

Apparently Bukkit.getWorld(worldName) returns a non-null world but attempting to load any chunks gives me a world unloaded exception

#

Even though my code gets called after WorldLoadEvents and such

wet breach
echo basalt
#

Huh

#

How can I ensure that?

#

Is there some type of event?

wet breach
#

well I don't know what your code looks like so not sure if the loading of the world is being done and then immediately after that code loading a chunk

halcyon shuttle
echo basalt
#

I'm doing something very hacky which is basically unloading a world, replacing region files async and reloading it async

#

Uhh

#

Yeah I listen to that

#

That event seems to be called as soon as I call createWorld or anything similar

wet breach
echo basalt
#

Not really

#

sync unload
async change, when done -> sync loading

wet breach
#

that isn't what you said above

#

but ok

echo basalt
#

it's a bit annoying

#

this is roughly the process

#

lots of latching, futures and lambdas are involved

#

I make sure to resync some essential stuff like teleports and such

#

oh yeah and there's a 50% chance the server crashes with a huge chunk log (I assume loading world)

vague oracle
#

Why not use 1 world, I swear that’s how every sever I have played works

echo basalt
#

Scalability

#

This core is made to dynamically load worlds, pull islands from a central database (mongo / sql) and load them whenever

vague oracle
#

How is that scalability

echo basalt
#

You can have 200 island servers

#

and handle 2000 islands

vague oracle
#

Or 1 world with each island spaced x Amount away

echo basalt
#

You'd have to sync islands and such

#

This is closer to a hypixel skyblock island system

vague oracle
#

My bad should have asked

#

What version

echo basalt
#

1.8 - 1.18

#

whatever works

#

Just read the readme next time

vague oracle
#

Well if it’s base 1.8, 1 server can hold like 400 plates

#

I didn’t open the link xD

echo basalt
#

Yeah 400 won't do it

vague oracle
#

How big is your server?

echo basalt
#

This is a public project

vague oracle
#

Give me a min I think I have an idea

echo basalt
#

I'll do some test runs on 1k players but I really don't want to be limited by player counts

wet breach
#

not sure why people insist on continuing to support old verisons

#

Which version are you having issues?

echo basalt
#

I currently run tests on 1.17.1

#

And will add support for lower versions as the project develops

wet breach
#

well, lastest is 1.18

echo basalt
#

Ehh I started this before 1.18 was a thing

#

It should still work, as long as I update the .mca files

#

I don't use NMS so

#

¯_(ツ)_/¯

vague oracle
#

Ok so how about this, instead of doing worlds per server, do x islands per server. For example if you want to only have 100 player on a server, the amount of islands in the 1 world would be limited to 100. Then, when a player logs on to the hub and selects the gamemode, access the database and check if there are any servers with free slots in its worlds. Then load them into the server the same way you are doing now, but instead of worlds, a 100x100 chunk.

echo basalt
#

1 world is usually 1 island

#

Pasting the islands without unloading a world is a challenge

wet breach
#

you want each player to have their own island in their own world?

vague oracle
#

Im saying to help reduce RAM/Storage/CPU usage use 1 world.

wet breach
#

that isn't going to be feasible

echo basalt
#

Not all in 1 server

#

Basically I have up to 25 islands (configurable) in a server

#

And you basically lend a world from an island server

#

it loads the world with your island

wet breach
#

that isn't a scalable solution or scales horribly

echo basalt
#

you can play, whatever

wet breach
#

anyways its up to you, I am not entirely sure where it is going wrong in your code

echo basalt
#

then when you leave, your island gets saved to a database and the world gets released for another island

wet breach
#

hopefully someone else might spot the issue in your code 🙂

echo basalt
#

Each instance only needs enough resources for 25 islands / worlds running at once

#

Which you can ofc lower if you don't have that much RAM / cpu / whatever

#

The database might get overloaded but I can segment database stuff in the future

mellow gulch
#

if each player is in their own world, why do this in smp?

#

honest question

echo basalt
#

The intention is to have multiple island servers and keep a seemless island world across them all

#

Without instances keeping copies of the island after unloading them

#

And then there's a bungee side that handles matching members together so I don't load the same island on 2 servers simultaneously

#

and some redis stuff because some servers have more than 1 proxy...

vocal cloud
#

You could always go a more sharded route with each sub server have up to x dedicated islands on it. Having 1 server per person has the issue of all that extra resources that each server would require

echo basalt
#

Oh I'm not doing 1 server per person

#

Each server has 25 islands that can be loaded at any time

#

Once the entire island team logs off, that world is unloaded and reverted to being a plain void world

vocal cloud
#

I imagine you could have way more islands per server though since chunk loading wouldn't really be an issue.

echo basalt
#

To load an island I need to unload the world, replace region files and reload it

#

25 is a safe number, I have a .yml file that you can just set whatever number you want

wet breach
echo basalt
#

FAWE breaks stuff

#

It's an option

#

but I prefer native files

wet breach
#

that didn't really answer why you need to mess with region files

#

to load or unload a world that contains an island

echo basalt
#

The island's contents are saved on the region file

buoyant viper
#

fuck it, 24

wet breach
#

if each island has its own world, then why mess with the region files when you can just invoke the unload or load for the world

echo basalt
#

includes crop status, lighting and whatever

#

The world is made from region files

#

the island worlds are just templates where the region files are pasted on top

wet breach
#

don't need to explain to me mojangs format

echo basalt
#

I don't serialize the entire world, only the region files

wet breach
#

you don't need to serialize anything

#

I can load and unload a world without ever touching a region file in code

echo basalt
#

I want to load the same island across 2 servers ... ??

wet breach
#

then you are better off saving that island in a different format

#

instead of messing with region files

vague swallow
#

Hellooo

#

I was wondering if someone could help me please?

onyx fjord
#

?ask

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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

vague swallow
#
Main main;

    public int getInt(UUID id) {return main.getConfig().getInt("Player." + id + ".Int");}

    public String Att(UUID id) {
        String a = "[Admin]";
        String b = "[Player]";

        if(getInt(id) == 0) {
            return a;
        } else return b;
    }

    @EventHandler
    public void Chat(AsyncPlayerChatEvent e) {
        e.setFormat(Att(e.getPlayer().getUniqueId()) + e.getPlayer().getDisplayName() + e.getMessage());
    }
#

Well

#

this is not working for some reason

echo basalt
#

your Main is probably null

vague swallow
#

It's sending normal messages

#

Main is just my main class

buoyant viper
#

oh

#

setFormat

vague swallow
#

setFormat is working

#

I think the problem is the UUID

buoyant viper
#

it uses String.format internally and needs to have 2 %s iirc

vague swallow
#

if I'm not using the Att() in the format it's working

#

I also got a huge error message in the console

#

But I can't upload screenshots here

buoyant viper
#

so like e.setFormat(Att(e.getPlayer().getUniqueId()) + " %s >> %s");

vague swallow
#
[01:37:14 ERROR]: Could not pass event AsyncPlayerChatEvent to StarWarsEssentials v1.0-SNAPSHOT
java.lang.NullPointerException: null
        at starwarsessentials.starwarsessentials.chats.test.getInt(test.java:14) ~[?:?]
        at starwarsessentials.starwarsessentials.chats.test.Att(test.java:20) ~[?:?]
        at starwarsessentials.starwarsessentials.chats.test.Chat(test.java:27) ~[?:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor63.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.16.5.jar:git-Paper-579]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[patched_1.16.5.jar:git-Paper-579]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.16.5.jar:git-Paper-579]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.16.5.jar:git-Paper-579]
        at io.papermc.paper.adventure.ChatProcessor.post(ChatProcessor.java:222) ~[patched_1.16.5.jar:git-Paper-579]
        at io.papermc.paper.adventure.ChatProcessor.processingLegacyFirst(ChatProcessor.java:102) ~[patched_1.16.5.jar:git-Paper-579]
buoyant viper
#

looks like main could be null

vague swallow
#
at io.papermc.paper.adventure.ChatProcessor.process(ChatProcessor.java:60) ~[patched_1.16.5.jar:git-Paper-579]
        at net.minecraft.server.v1_16_R3.PlayerConnection.chat(PlayerConnection.java:2085) ~[patched_1.16.5.jar:git-Paper-579]
        at net.minecraft.server.v1_16_R3.PlayerConnection.c(PlayerConnection.java:2000) ~[patched_1.16.5.jar:git-Paper-579]
        at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:1938) ~[patched_1.16.5.jar:git-Paper-579]
        at net.minecraft.server.v1_16_R3.PacketPlayInChat$1.run(PacketPlayInChat.java:43) ~[patched_1.16.5.jar:git-Paper-579]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_311]
        at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_311]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_311]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_311]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_311]
[01:37:14 INFO]: <Darth_Mango> hi
#

but my main is not null

buoyant viper
#

are u sure

#

bc i dont see it getting set anywhere in that code

vague swallow
#

The plugin wouldn't work without a main class

paper viper
#

... main isn't null, the config is

buoyant viper
#

ok but do u make sure to set the fields value

buoyant viper
paper viper
#

you see, if you used java 16

#

it would tell you that

#

in the exception

#

:/

wet breach
#
        at starwarsessentials.starwarsessentials.chats.test.getInt(test.java:14) ~[?:?]
        at starwarsessentials.starwarsessentials.chats.test.Att(test.java:20) ~[?:?]
        at starwarsessentials.starwarsessentials.chats.test.Chat(test.java:27) ~[?:?]
#

would look around in Test at those methods

#

follow it from bottom to top

#

odds are its probably your getInt() method

vague swallow
paper viper
#

if its not the config, then yea all i can say is do what frostalf showed above

vague swallow
paper viper
#

same value?

vague swallow
#

yes

wet breach
#

?DI

paper viper
#

?di

undone axleBOT
wet breach
#

of course its case sensitive

paper viper
#

lol

karmic bear
#

hey uh, theres multiversion servers, and lets say I have multiple clients and custom textures on my server

#

how do i make sure 1.8 resourcepack goes to 1.8 clients?

wooden fable
#

Hey can someone help? I'm trying to create a custom spigot fork but when i build the project with buildtools there is no pom.xml so i can't use mvn? How can i setup buildtools with a pom.xml file?

timid kraken
#

is there a way to whitelist a player using the bukkit api?

wooden fable
# timid kraken is there a way to whitelist a player using the bukkit api?

I found this:

if(Bukkit.getWhitelistedPlayers().contains(player)){
//check if player is on whitelist
}
player.setWhitelisted(true); //set player on whitelist
player.setWhitelisted(false); //remove player from whitelist

Bukkit.setWhitelist(true); //enable whitelist
Bukkit.setWhitelist(false); //disable whitelist
Bukkit.reloadWhitelist() //reload whitelist
timid kraken
#

but how will i be able to get a player instance if the player has not ever joined the server before?

wooden fable
#
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(UUID);
offlinePlayer.setWhitelisted(true); //set player on whitelist
offlinePlayer.setWhitelisted(false); //remove player from whitelist

Bukkit.setWhitelist(true); //enable whitelist
Bukkit.setWhitelist(false); //disable whitelist
Bukkit.reloadWhitelist() //reload whitelist
#

Use OfflinePlayer

wooden fable
patent horizon
#

does translateAlternateColorCodes return a string or a textcomponent?

lavish hemlock
#

String

#

if you want to use the components API

#

just use one of the builders

#

translateAlternateColorCodes is considered "legacy" at this point

patent horizon
#

whats the hot new way to do color codes now?

#

and please don't tell me concat ing strings is preferred

sullen marlin
#

translateAlternate is fine

lavish hemlock
#

I use the term "legacy" here as any usage of color codes is deemed "legacy" since it uses Minecraft's legacy text

#

components (Bungee/Adventure) are preferred

wooden fable
sterile token
#

Hi, Im again i have read what someone sent about Apache http client. But i cannot find how to send ONE post with json parameters and files (all at the same time).

golden turret
#

1.8

peak granite
#

how do i set item in hand, amount currently held - 1

tidal skiff
#

so im tryna make a bed trap and i need the bed that was placed to be added to a hashmap of the bed and the player who placed it but i dont know how to get the bed the player placed as a Bed class to put in the hashmap

#

cuz i also need to detect if a player enters the bed

quaint mantle
tidal skiff
#

or can i just make the program see the bed as a block and i can still use bed enter event and shit

tidal skiff
#

so i cant just store 1 location

#

ok im just gonna try that

quaint mantle
#

PlayerEnterBedEvent has a getBed method

tidal skiff
#

im trying to get the Bed object and put it into a hashmap as its placed not when someone enters it

#

how do i get the bed object from a blockplaceevent is what im tryna say

quaint mantle
#

Listen to BlockPlaceEvent then

hasty prawn
quaint mantle
hasty prawn
tidal skiff
#

this is what i did

        if(e.getItemInHand().isSimilar(Recipes.EXPLOSIONBED)){

            traps.put((Bed) e.getBlockPlaced(), e.getPlayer().getUniqueId());

        }
#

is that alright or is it shit

hasty prawn
#

That's fine

tidal skiff
#

alr ty

hasty prawn
#

Provided Recipes.EXPLOSIONBED returns an ItemStack that's a bed, which I assume it does PauseChamp

tidal skiff
#

lol it does

native gale
#

How to check if biome is snowy?

hasty prawn
#

Like, if it snows in the biome?

native gale
#

Yes

hasty prawn
#

You might not be able to, I assume that's client side.

#

The server just tells the client the current weather state I'm pretty sure

candid galleon
hasty prawn
#

Seems like a not very good way to do that

#

It might just be best if you write out all the biomes that snow and check against that method 🤷‍♂️

#

Depends on what you need it for specifically

native gale
buoyant viper
native gale
#

Although, it's absolutely possible, it's Mojang after all

buoyant viper
#

just compared it against a handful of biomes

buoyant viper
native gale
#

That sounds intriguing for some reason

hasty prawn
#

How accurate does it need to be? I think some biomes it can snow AND rain depending on altitude.

buoyant viper
#

basically the server tells the client its not raining, and then it starts raining

native gale
#

If it's raining ofc

hasty prawn
#

Then yeah you're going to have to use the altitude of their current position as well then

#

Like, it will snow on top of mountains but not at the bottom, even though they can be the same biome.

native gale
#

Oh, didn't think about that

#

Hmm, what am I gonna do then

buoyant viper
#

leave to mojang to give us pain and suffering

native gale
#

Ah-ha

#

if(world.getTemperature(x, y, z) < 0.15) { /* ... */ }

#

That should work I guess

#

The required temperature values for snow and rain are less than 0.15 for snow and above 0.15 for rain.

#

The only thing I don't like about this explanation

#

Is that it doesn't explain what should happen at temperature == 0.15

buoyant viper
#

ah so they actually made it easier to check weather? pog

young knoll
#

I believe it's < 0.15 in the code

#

So 0.15 would be rain

wet breach
#

just set it to 0.15 and find out

lucid mirage
#

Hi

#

So I am not sure if this is possible anymore as I haven't seen anything to help me with this

#

But I have seen other spigot plugins do this so I think it is

#

So I need help making my arguments in my commands basically say what the arguments are for

#

like mid typing the command

#

lemme get a screenshot on what i mean

#

And also show certain options instead of just showing a list of players

#

ok, well I cant send a screenshot :/

#

But does anyone know what I mean?

eternal oxide
#

implement TabExecutor instead of CommandExecutor

lucid mirage
#

What is tab executor?

eternal oxide
#

You can then control what options are shown in the TabCompleter method

lucid mirage
#

Oh

#

alr

#

Ok, so how do I use the TabCompleter method

#

does it show it automatically?

eternal oxide
#

depending on the length of args you return a List<String> of the options you want to show

lucid mirage
#

Ah ok

last ledge
#
        if(event.getBlock().getType() == Material.IRON_ORE){
            event.getBlock().getDrops().clear();```
#

why doesnt it clear the drops

lucid mirage
#

my best guess is to try that

#

ik I have to do that with strings

buoyant viper
#

doesnt getBlock and getDrops return copies

lucid mirage
lucid mirage
# last ledge ??

The reason why i say to do this is because ItemStacks are messed up

eternal oxide
#

Theres nothign wrong with ItemStacks

lucid mirage
#

o

eternal oxide
#

Use the correct event and iterate the Items

lucid mirage
#

Well I mean like whenever I do if (player.getInventory().getItemInMainHand() == stick) {}

#

the if statement never runs

young knoll
#

Well yeah

#

.equals

eternal oxide
#

Thats instance checkign and will always fail

young knoll
#

Or in this case, isSimilar

lucid mirage
#

and I made a variable for stick as an ItemStack

eternal oxide
#

Compare Enums with ==, objects with .equals

#

Your variable will never == the item in hand

lucid mirage
#

So i have been doing this all wrong 💀

eternal oxide
#

you use stick.isSimilar(getItemInMainHand())

lucid mirage
#

Ah ok, thx for the help

tidal skiff
#

how do i get the direction between 2 points

#

im trying to find what direction to teleport the player in to get closer to a block

eternal oxide
#

final Vector directionVector = targetLoc.toVector().subtract(startLoc().toVector());

tidal skiff
#

ty

dark arrow
#

is it possible to make crafting recipe to get armour more that prot 4

young knoll
#

Sure

wet breach
dark arrow
#

yah but i want t o make is to that players could cratf armour which has aprotection value of mroe than pro 4

#

by using speacial things

#

thats why i am asking is it possible to make armour more than prot 4

#

or any enchants more then their max level

#

cuz when i use commands to make these items

#

is does not say the enchant discription properly

#

like for prot 4 armour it says "Protection IV" and for prot 10 armour generated by commands it says "proTection lvl:-10"

ivory sleet
#

Yeah that’s an issue of the client tho

#

Or well

#

Protection X should work fine?

#

Altho what you wrote indicates you tried to give yourself negative protection

ivory sleet
#

/give @s wooden_sword{Enchantments:[{id:protection,lvl:10}]} 1

#

That should work splendid, and it should say Protection X

dark arrow
#

ok

#

yah it does

#

thx

#

now how will i implement in plugin

ivory sleet
#

Basically

#

What do you have as of now?

dark arrow
#

i am thinking of making a crafting recipe

#

if we covered a sharnpness 5 dia swro with diamond in a crafting table

#

it should give out sharpness 6

#

so i was asking for help about it

ivory sleet
#

You got some code?

#

I won’t be doing this for you, but I don’t mind guiding you loosely through it, with that being said I do demand that you have actually given it a try first, before coming here.

tender shard
#

@dark arrow normally you'd want to use a RecipeChoice.ExactChoice

#

Buuuut

#

that won't work if your sword is already damaged or has been renamed on an anvil etc

tidal skiff
tender shard
#

you will need to use the CraftItemPrepareEvent or however it's called

tidal skiff
young knoll
#

Thanks for reminding me about my idea to add a PDCChoice

#

Although that doesn’t really help here either

tender shard
#

what will it do?

tender shard
young knoll
#

Matches the item as long as it has the designated PDC entry

tender shard
tidal skiff
tender shard
#

oh

eternal oxide
#

You are spawning them with a velocity vector

young knoll
#

They don’t have a vector iirc

#

Just a speed value

tender shard
buoyant viper
#

yes

tidal skiff
tender shard
#

oh I meant you @tidal skiff

#

show your code pls

buoyant viper
#

smh

tidal skiff
#
i.getWorld().spawnParticle(Particle.FLAME, new Location(i.getWorld(), base.getX() + -bounds, i.getLocation().getY(), base.getZ() + -bounds), 1);
i.getWorld().spawnParticle(Particle.FLAME, new Location(i.getWorld(), base.getX() + bounds, i.getLocation().getY(), base.getZ() + -bounds), 1);
i.getWorld().spawnParticle(Particle.FLAME, new Location(i.getWorld(), base.getX() + -bounds, i.getLocation().getY(), base.getZ() + bounds), 1);
i.getWorld().spawnParticle(Particle.FLAME, new Location(i.getWorld(), base.getX() + bounds, i.getLocation().getY(), base.getZ() + bounds), 1);
#

i is the player object btw

#

its in a for loop

tender shard
#

try to use the function that also lets you define the offset for x,y,z

#

and set it to 0

#

spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force)
azure phoenix
#

and it compiles, but the result in Spigot/Spigot-Server/target

#

when I try to run it it gives this error (gimme a sec)

tender shard
#

oh wait

azure phoenix
#
Error: Unable to initialize main class org.bukkit.craftbukkit.Main
Caused by: java.lang.NoClassDefFoundError: joptsimple/OptionException
Press any key to continue . . .
tender shard
#

the .jar you want to run is NOT in that directory

azure phoenix
#

ik, but I want to patch spigot

eternal oxide
tender shard