#help-development

1 messages Β· Page 1970 of 1

wet breach
#

never heard of async with no other threads

#

even Java's API's for futures creates threads

#

unless you are confusing child threads with daemon ones o.O

lost matrix
#

When the chunk unloads then the entity object is invalidated.
You should usually not have hard references to game objects anyways.
If you want to tick it again when the chunk loads then you should save its
state in the ChunkUnloadEvent in its PDC and load it again in the ChunkLoadEvent.

grim ice
#

can do it for y

#

u can do it urself

#

cuz I can do it

#

and im not that good (not as good as most people here)

thick tundra
lost matrix
#

Distributing work over multiple ticks is the more correct description of the word async than using threads is.
You can have code that uses threads that is not asynchronous. You can have asynchronous code that does not use threads.
Async is not interchangeable with parallel/multi threaded.

#

But tell me if you find other sources on that topic.

grim ice
#

does it use shared objects

#

to like interact with the main thread

wet breach
lost matrix
sick ermine
grim ice
#

that doesnt make sense

wet breach
grim ice
#

oh then im just stupid

wet breach
#

but as I also said, these days the definition of it is changing

lost matrix
grim ice
#

Oh right, u can use threads and the tasks happen at the same time

lost matrix
wet breach
#

you can have two threads that are synchronized

grim ice
#

async is splitting tasks into several tasks

#

then performing seperately

#

with a time in between, that isnt too big or too small, so they do not lag the machine

#

is that correct

sick ermine
#

Help me

grim ice
#

but should be in milliseconds

lost matrix
wet breach
#

yep better stated then what I was going to type

#

the time between the tasks isn't the relevant part

grim ice
lost matrix
grim ice
#

oh the time thing is wrong

wet breach
#

just as long as the tasks are not being done at the same time is what is relevant. AKA the definition of asynchronous is not occuring at the same time

lost matrix
# grim ice thats what i said but removing the white space

Async does not mean that you split something into little tasks and compute them separately.
But splitting something into little tasks to compute them separately is an async action.
An apple is a fruit but not all fruits are apples.

wet breach
#

so yes, 7smile7 is technically correct

grim ice
#
private void a(){
//shit ton of code here
}
//into
private void b(){} private void c(){} private void d(){}
//then 
private void a(){
 b(); sleep(10) c(); sleep(10); d();
}```
#

imagine sleep thing is scheduling

#

and not pausing the whole thread

#

will it be what you mean

wet breach
#

or just use a loop that pauses for a bit of time before it goes through the loop again πŸ™‚

#

would be the easier way to demonstrate that

lost matrix
grim ice
#
for(int i = 0; i == 100; i++){
if(i == 33){
doTask();
}
if(i == 66){
doFirstTask();
}
if(i == 99){
doSecondTask();
}
}```
#

smth like this?

wet breach
grim ice
wet breach
#

would technically meet the definition of not occurring at the same time, if the task completes in a millisecond

heavy fulcrum
#

ive been trying to make a so-what blank spigot plugin but doesnt ever seem to work. ive used Maven for the dependencies, pls help

grim ice
#

time to make a AsyncMethod class, with a run method, and a method to check if method is done

#

B)

wet breach
#

basically async is breaking up a task into smaller pieces to be done over a period of time

#

as long as the those small pieces are not done at the same time

crimson terrace
#

could you use your own threads instead of using the asynchronous tasks?

lost matrix
grim ice
#

what is better, multithreading or async

wet breach
#

depends on the task

lost matrix
grim ice
crimson terrace
#

perfect

grim ice
#

so what i should do for max performance is to

#

make an async task

#

and only do the next task

#

if that task is .isDone()

#

if not then i have to wait

lost matrix
crimson terrace
grim ice
#

what the fuck bro

crimson terrace
#

crap

lost matrix
#

Joining will block the thread it is called on

grim ice
#

ur seriously a wikipedia

wet breach
#

well if you want performance, probably better off spinning up a separate thread for that asynchronous task

lost matrix
grim ice
wet breach
#

probably better to sync to a method then the whole thread lol

#

but yeah scheduler is the better way on that one

lost matrix
wet breach
heavy fulcrum
heavy fulcrum
#

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>me.itzzbuoyy.myplugin</groupId>
<artifactId>MyPlugin</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<resources>
<resource>
<directory>${project.basedir}/src/main/resources</directory>
<includes>
<include>plugin.yml</include>
</includes>
</resource>
</resources>
</build>
</project>

lost matrix
undone axleBOT
wet breach
#

use that link please to put it there

#

makes it easier to read

heavy fulcrum
#

ok!

lost matrix
young knoll
#

Don’t you

wet breach
#

I write on it all the time o.O

#

anyways what I was going to say in response to that is really all you need is a smart phone or tablet πŸ˜›

minor garnet
wet breach
#

gone are the days of needing a pc for programming XD

minor garnet
#

some1 know why the armor stand is dont rotating to my direction?

wet breach
#

well they are not necessarily gone, just no longer a strict requirement

young knoll
#

Programming plugins without the ability to run the game sounds painful though

lost matrix
wet breach
#

what a nice illustration you created

heavy fulcrum
minor garnet
lost matrix
minor garnet
#

ah sure

#

but one doubt

#

a player can right-click, send a packet to the server that the player clicked on, but it will happen that it was made after 20ms, but if I get this packet in an async scheduler I make it make that packet more fast?

heavy fulcrum
lost matrix
minor garnet
wet breach
#

well seems 7smile7 has it handled from here so off to bed it is for me.

lost matrix
lost matrix
wet breach
#

Lol, no

lost matrix
#

I thought so lol

wet breach
#

I am not even remotely close to having german in me either XD

lost matrix
#

XD

minor garnet
#

i have asked u before

wet breach
#

my lineage is the French one sadly, but I live in the US. I just don't have the same sleep schedule as everyone else in the US πŸ˜›

lost matrix
wet breach
#

also you are correct for most people they should use API's πŸ˜‰

lost matrix
lusty portal
#

Salut c'est ici que je peux mentionner des soucis avec spigot?

lost matrix
minor garnet
#

but if i move it sharply it rotate, it's very strange

lost matrix
#

If i understood you correctly

lusty portal
#

on the site I don't know how to create a topic :/

lost matrix
lusty portal
#

ok

heavy fulcrum
#

pls help my plugin doesnt work its a blank one

lost matrix
wet breach
heavy fulcrum
#

i compile using a maven command

#

also im coding on android

river oracle
#

what

wet breach
#

well your issue is going to be compiling obviously

#

android JDK isn't exactly the same as Java JDK

heavy fulcrum
#

ok

#

if u can look it up theres an ide on the google play store named CodeSnack

lost matrix
# heavy fulcrum is this ok?

Ok so the first thing that jumps to my eye is your java version. You should use java 17 when developing spigot plugins.
What do you mean by "blank"

heavy fulcrum
#

so by blank i mean the plugin doesnt have any content, it just has the onEnable and onDisable

river oracle
#

plugin.yml?

heavy fulcrum
minor garnet
#

do you see the ''dir'' on action bar is changing but the armor stand dont rotate

#

just when i move ungly

blazing scarab
river oracle
heavy fulcrum
#

im coding on mobile...

lost matrix
river oracle
heavy fulcrum
#

yes im running the server on minehut

#

im kinda dumb

minor garnet
#
    private void makeLook(ArmorStand armor, Player player) {
        final Location loc = player.getLocation();
        final Location eloc = armor.getLocation();
        
        final Vector dif = getDirection(eloc, loc);
        dif.setY(0);
        armor.teleport(armor.getLocation().clone().setDirection(dif));
        player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("Β§cDir: x - " + dif.getX() + " z - " + dif.getZ()));
    }```
#

if you see is calling this method everytime on a thread

river oracle
minor garnet
#

i just want when the entity spawn is alright rotate to player direction

heavy fulcrum
#

console keeps telling couldnt load <plugin name>

minor garnet
#

same if the player move slow

heavy fulcrum
#

hold on ill get a log file

minor garnet
#

if you want use the code

heavy fulcrum
#

this is the log file

lost matrix
river oracle
# heavy fulcrum
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml```
#

do you not know how to read errors?

minor garnet
#

like i sayed im using a thread

lost matrix
# heavy fulcrum

invalid plugin.yml -> invalid CEN header (bad signature)
You need to fix that

lost matrix
heavy fulcrum
minor garnet
lost matrix
river oracle
#

I'm so confused how you can code on mobile without going insane and wouldn't the slightest idea how to fix anything wrong sorry

minor garnet
#

other thing

young knoll
#

Ohboy

wet breach
lost matrix
wet breach
#

ah well you said hologram in the beginning

wet breach
#

anyways that is obviously my queue to leave now XD

lost matrix
#

This looks like it needs to be split in at least 3 methods

#

Anyways this is nothing someone could help you with. It is probably some oddity within your code or with the version you are using.
I cant find anything in your code that would cause this.

minor garnet
#

this sad

lost matrix
#

All you can do is debug. Everything.

wet breach
#

if that is correct in my understanding, then the issue is going to be in the locations

#

player location is only ever updated when player moves

lost matrix
#

The issue is that it is not rotating instantly when it spawns but only if the player moves a bit

wet breach
#

sounds like a client side glitch

#

but also, players moving also cause updates to happen too

lost matrix
#

Newer versions have a method to assures that the entity is spawned with the right metadata right away. Not sure if 1.12 has that

minor garnet
#

hm

wet breach
#

I don't think 1.12 does

#

in versions before 1.16 I recall that metadata packet is separate

lost matrix
#

Should still be a separate packet. But spigot only sends the metadata for spawned entities so one tick later.
With this method its sent right away

lost matrix
minor garnet
#

a tick later using a syhnc run task later?

lost matrix
#

Sure. There is not really an alternative to running something a tick later ^^

wet breach
#

yeah debugging is going to be your best option here. I would even test with more the one client too

#

to rule out client causing it

minor garnet
#

if i use ''armorstand.setHeadPose''

#

using a vector with pitch and yaw

grim ice
#

the Runnable run method

#

how many times

#

will it run

minor garnet
#

what

lost matrix
grim ice
#

u didnt show how u did it

#

u prob would want to add that its running every tick, for no brains like me who got confused

wet breach
#

your math is incorrect btw

lost matrix
minor garnet
#

i cant understand so mutch words

lost matrix
#

Its kinda old and i wrote it about one year after i touched my first programming language

minor garnet
#

?

grim ice
#

and in here

lost matrix
grim ice
#

there is no constructor

lost matrix
grim ice
#

FUCK

#

II DIDNT SEE THAT

#

my bad

wet breach
#

I have a feeling that either it is going to be a client side thing or it has to do with how you are using the locations

#

but hard to tell with limited view in terms of code though.

grim ice
#

and u didnt show how u used ur code

minor garnet
#

and if you use the setheadpose method

grim ice
#

I assume you did something similar to the "problem" here

#

but instead of world.get.....

lost matrix
grim ice
#

you make a new object of the PlacableBlock

minor garnet
wet breach
#

most of us here well some of us who are knowledgeable generally don't spoonfeed and rather give proof of concepts as it forces you to learn it either way to make it work πŸ˜›

grim ice
#

then after the loop you make a Thread with the workloadthread class

grim ice
#

just wanted to see how your own example works

lost matrix
grim ice
#

Anyways its a really good guide

#

BTW, if you make a thread manually

#

and pass a runnable to it

#

it will run once, unless you change that

#

right?

lost matrix
grim ice
#

but how do you add loads to it

#

since you're gonna pass the runnable to your thread

lost matrix
#

You keep that instance of course. And then you just call addLoad(WorkLoad)

#

And it will get computed when the server has time for it.

grim ice
#

changing the instance of the runnable, will also change the thread that has been made out of the runnable???

lost matrix
#

Might be in the next tick. Might be in 3 seconds.

grim ice
#

you have the runnable in your main for example, then on ur enable u make the thread with the runnable, when u add the load with Main.getRunnable().addLoad(load); for example, u added it to that runnable, but the thread has received the runnable without the adding, since onEnable ran first?

#

Oh wait

wild reef
#

Hey so right now I am using the PlayerCommandPreprocessEvent to check for used commands by players. Is there a similar event which also has track of the console?

grim ice
#

do you not pass the object to ur thread

#

but instead use a scheduler

wet breach
grim ice
#

I wish you provided a github for it tbh

#

People will copy it for sure, but that's nothing of your worries, it's their problem that they won't progress, and on the other hand it will help people who didn't get it since 50% of the example is missing

lost matrix
vapid thorn
#

is there a event that can be used to detect when a sculk sensor is triggered by chance?

minor garnet
#

other thing

#

how i set the entity nbt?

lost matrix
vapid thorn
#

also, figured it out with BlockReceiveGameEvent

#

It was mostly for to make sure vanished staff didnt get picked up by the sculk sensors we had around xD

minor garnet
vapid thorn
grim ice
#

@lost matrix u can use linear processing instead of looped processing too

#

right?

#

so u couldve spawned the particles with the first method, the one that waits 45ms between each session of computing

minor garnet
quaint mantle
hexed hatch
vapid thorn
#

same with bundles

grim ice
#

ig i was wrong

#

but you can make a method to refill the deque

#

so in the run method just check if its empty and refill

#

its honestly confusing, i think ill wait until you finish the github

#

since there are some missing things

minor garnet
#

I DONT WANT USE EULER ANGLE

grim ice
#

this part is so confusing

#

it was not explained at all

#

ive been on it for like 40 mins

#

i dont get it

lost matrix
grim ice
#

okay

#

what i get from the code

#

is that there cant be more than 2 workloads rescheduled

valid solstice
#

how to make it only work on legs?

#

meta.addAttributeModifier(Attribute.GENERIC_MOVEMENT_SPEED, new AttributeModifier("extra_speed", 0.4, AttributeModifier.Operation.ADD_NUMBER));

#

this the current thing im doing to the meta of it

vale ember
#

AttributeModifier(UUID uuid, String name, double amount, AttributeModifier.Operation operation, EquipmentSlot slot)

valid solstice
#

tysm

vale ember
#

np

sharp flare
#

you can use random uuid for it if u want

valid solstice
#

how

vale ember
#

UUID.randomUUID()

valid solstice
#

oh thats it...

#

ok thank you!

sharp flare
#

that

minor garnet
#

I Just want do It because i cant change the headpose withiut use vrctora

quaint mantle
#

Why wouldnt just use vectors?

cold field
#

Guys I was wondering, does it exists a simpler way to ban a player instead of getting the ban list and updating it?

maiden thicket
#

some create their own ban handling system instead of using vanilla banning

cold field
#

-.-

olive lance
#

What are good uses of reflection besides sending a packet on multiple versions

hexed hatch
#

Good uses of reflection? That’s an oxymoron

somber sequoia
#

How could I make a player invincible to lava/fire damage without fire resistance, is there any event that is run when a player gets hit by fire tick? Or just something that makes a player fully invincible to any attack

hexed hatch
#

Entity damage event and cancel if it’s for a certain reason

somber sequoia
#

Thanks

worldly ingot
# cold field -.-

I mean it was a valid answer. What were you expecting? The way you described is literally how you add someone to the ban list lol. You get it, and add the player to it. You cannot get simpler than that.

#

It's still one line. Bukkit.getBanList(BanList.Type.NAME).addBan("name", "reason", null, "banner")

quaint mantle
#

hi choco ❀️

opal juniper
vernal pier
#

is there a way to add a single .class file into dependency? or do i have to make it to a jar first? (am using gradle)

quaint mantle
#

Wat

opal juniper
#

no

maiden thicket
vague swallow
#

How can I make these items that are getting placed in your inventory if you click a red recipe?

lost matrix
worldly ingot
#

100% client side, yeah

vague swallow
#

okay

#

thanks

tardy delta
#

i want fruits

#

especially mango

#

lets eat it

rough drift
#

CommandSender#sendMessage(BaseComponent...) is deprecated, i found the one using Identity, however idk how to use it

ivory sleet
#

Pretty sure you can use Identity.nil() (iirc)

rough drift
#

yep

red sedge
#

why does Damageable#setDamage(damageableMaterial#getMaximumDurability() - 1) break the item

tardy delta
#

lmao got a tv to code on

#

thats what every programmer wants

red sedge
#

not really

tardy delta
#

πŸ˜‚

red sedge
#

you already break instantly in creative

#

also how tf is that even a function

#

block break event is called after the block is broken

#

i believe both

#

but you should still try it and see

full forge
#

how do I save a config file to the plugins/plugin directory, I'm using this.saveDefaultConfig() but the directory isn't appearing

tardy delta
misty current
#

how can I put nbt in a tileblock in 1.18?

red sedge
#

hm?

misty current
#

let's say i have a chest

red sedge
#

im not sure if you can add custom data to them

misty current
#

and i wanna put some nbt tags into it

spiral light
#

use PDC not nbt

misty current
#

i am trying to use nbt because i wanna test a concept

#

hold on lem,me get the video

red sedge
#

what r u trying?

misty current
#

https://www.youtube.com/watch?v=0NxJWN7gGHI&t=428s if you go to 6:25 you can see how the hopper treats the spawner as a chest

This Minecraft glitch allows for FIVE pig spawners to generate?!
Β» Gamersupps! - Get a free sample pack! - https://gamersupps.gg/discount/AntVenom
Β» Breaking Minecraft Playlist - https://www.youtube.com/playlist?list=PLR50dP3MW9ZWMSVz2LkRoob_KRf72xcEx

Β» Get a Minecraft Server - http://mcph.to/AntVenom

Special Thanks to Matthew Bolan for introd...

β–Ά Play video
#

it happens because the chest spawns on top of the spawner in world gen and so the spawner has the nbt of the chest

#

i want to try and replicate this behaviour

spiral light
#

but thats also easy to use with PDC

#

anyway, you can get the nms-Block via the World (CraftWorld->WorldServer->getTileEntityAt or smth)

red sedge
#

Max durability: 1561 Durability to Damage: 1560
Why does the item breaaakak?

#

i set the damage to 1560

#

the max durability is 1561

#

but item be gone

misty current
#

i got the block already, im just looking for the correct method to manipulate the tileentity compound

misty current
#

without making my own hopper ticking

quaint mantle
#

Hey there! Is there an event triggered when farmland turns into dirt by dehydration?

misty current
#

should be BlockPhysicsEvent

#

but pay attention because block trampling is not the only thing that calls it

red sedge
#

I have a custom durability system

#

and whenever the item gets to the breaking point

#

i just want to assign it a broken nbt instead of it actually breaking

#

so i need to prevent the breaking

#

I have this in place to make it set to 1

#

wrong one

#

((Damageable) meta).setDamage(itemStack.getType().getMaxDurability() - Math.max(1, durabilityToSet));

hasty prawn
#

Try 2 I guess

quaint mantle
misty current
red sedge
misty current
#

are you sure it's the same thing? isnt this called when farmland becomes dry/wet

#

he wants to know when tilled soil becomes untilled

hasty prawn
quaint mantle
misty current
#

soil can become dry and not untill for a while

red sedge
misty current
#

with moisture level i guess they mean the wet state of the block

hasty prawn
#

The variable, durabilityToSet

tardy delta
#

ye

hasty prawn
#

what is it equal to

red sedge
#

uh its set to Math.max(0, (int) (durability * itemStack.getType().getMaxDurability()))

#

and durability is customDurability / customMaxDurability

tender shard
#

won't that return 0 everytime?

#

5/7 = 0 if it's an int

red sedge
#

no

#

durability is a double

tender shard
#

well what else would it be

#

but

red sedge
#

so it gives a value in 0s

tender shard
#

oooh

#

I see

red sedge
#

i cast durability * itemStack.getType().getMaxDurability()) to int

#

so it would be like idk 1203 instead of 1203.000022

tender shard
#

yeah

hasty prawn
#

Well if durability is over 1, then the item is always gonna break

red sedge
#

yeah but why would it ever be over 1?

hasty prawn
#

wait wait

red sedge
#

Max durability: 1561 Durability to Damage: 1560

I set the damage to 1560

#

and it breaks

#

i dont see how any of this is related lol

quaint mantle
#

Hmm BlockPhysicsEvent is not called when a player jumps on a farmland block

real palm
#

So guys (and gals), once more I need advice.

better said related to the Scoreboard thingy.

I set with Team#addPlayer in a for(player all : bukkit.getonlineplayers()) each role in the tablist. so far so good, however the addPlayer(OfflinePlayer) is deprecated.
JavaDocs refering to addEntry(String) but what do I put there? Playername, UUID Trimmed or UUID Untrimmed?

tender shard
#

print out the result of your calculation

#

I am pretty sure you always set it to 0, as I said

red sedge
#

Durability to Damage is the proof of that

tardy delta
#

Player#getName

real palm
#

ah, awesome

#

thanks, gotta try that out! :awe

#

right, cant use my emotes here πŸ˜’

quaint mantle
tardy delta
#

πŸŽƒ

brave sparrow
#

Block physics is more when world physics makes something change rather than a direct player action

quaint mantle
#

Hi, How do I change the texture of a player head block to a custom head?

tardy delta
#

isnt PlayerInteractEvent associated with mouse clicks?

lost matrix
eternal oxide
#

PIE is also when you walk onto a pressure plate

lost matrix
tardy delta
#

ye and player activated redstone stuff but i dont know about that

#

alr

quaint mantle
lost matrix
#

Hm. Wasnt there a recent PR for a GameProfile abstraction?

#

PlayerProfile or something

lost matrix
quaint mantle
#

yes I am using 1.18

lost matrix
#

Alright one moment

worldly ingot
#

Doesn't support Base64 textures afaik

quaint mantle
#

Is it possible with Multiverse that all worlds that have ever been created are unloaded and not reloaded when the server is started and if so, how?

young knoll
quaint mantle
young knoll
#

yep

quaint mantle
#

How do I change the head texture then?

young knoll
#

PlayerProfile

wooden fable
#

Does Player#performCommand work with bungeecord commands? Or do i need to use Player#chat?

lunar forge
#

I got a question about the spigot 1.8 api, how could I check if a material id equals xx:xx for example. Because it returns an int, and I can't check this:
type.getId == xx:xx

lost matrix
# quaint mantle Can I just skip the base64 then? Minecraft Heads has direct url to the skin file

Well looks like it really doesnt support bas64 textures.
Then ill just provide my util method:

  private static final Map<String, ItemStack> base64HeadCache = new Object2ObjectOpenHashMap<>();

  private static GameProfile createProfileWithTexture(final String base64Data) {
    final GameProfile gameProfile = new GameProfile(UUID.randomUUID(), null);
    gameProfile.getProperties().put("textures", new Property("textures", base64Data));
    return gameProfile;
  }

  public static ItemStack produceHead(final GameProfile gameProfile) {
    final ItemStack newHead = new ItemStack(Material.PLAYER_HEAD);
    final SkullMeta headMeta = (SkullMeta) newHead.getItemMeta();
    final Field profileField;

    try {
      profileField = headMeta.getClass().getDeclaredField("profile");
      profileField.setAccessible(true);
      profileField.set(headMeta, gameProfile);
    } catch (final ReflectiveOperationException e) {
      e.printStackTrace();
    }

    newHead.setItemMeta(headMeta);
    return newHead;
  }

  public static ItemStack getHeadFromBase64(final String name, final String base64Data) {
    return UtilItem.base64HeadCache.computeIfAbsent(name, pName -> UtilItem.produceHead(UtilItem.createProfileWithTexture(base64Data))).clone();
  }
lost matrix
lunar forge
quaint mantle
lunar forge
brave sparrow
#

getId() == 162 && getData() == 13

#

Or something to that effect

lunar forge
#

alright thanks

brave sparrow
#

getId is gonna come from the material, getData is gonna come from the item or block

lost matrix
brave sparrow
#

As multiple things use the same material and just distinguish by data

lost matrix
#

Yes

#

It is

quaint mantle
brave sparrow
#

You use the methods in that Javadoc to do what you wanted

lost matrix
#

Honestly the PlayerProfile should support applying signed textures and base64 encoded ones...

young knoll
#

It supports base64 if uou decode it

brave sparrow
#

Yeah it’s just a base64 encoding of the texture and cape URL and other associated info

#

Which is pretty much what’s inside player profile

young knoll
#

And like I said, just decode the base64 or use the URL from minecraft-heads

opal juniper
#

ah i see

brave sparrow
#

It doesn’t look like you can set the signature for that though

young knoll
#

Maybe I should PR a method that takes a base64 string

brave sparrow
#

Which is unfortunate

quaint mantle
#

I don't really understand any of this.

#

Furthest I got on my own was finding a forum post that was using GameProfile and TileEntitySkull

lost matrix
quaint mantle
#

except that I can't use TileEntitySkull for some reason. Intellij just says that it "can't resolve symbol 'TileEntitySkull'"

misty current
#

you need to run buildtools for that probably

lost matrix
#

TileEntitySkull is a nms class. You shouldnt use that if you want to keep compatability.

quaint mantle
#

Well I also managed to find another forum post saying that "all nms packages unobfuscated net.minecraft.world.level.block.entity.TileEntitySkull" but I have no idea what that means

misty current
#

that's probably 1.18

wary harness
#

what are this lines on player

misty current
#

some entity hitboxes

#

actually not hitboxes but raycasts (?)

wary harness
#

that is more then one

misty current
#

i thnk thats the name

wary harness
#

raycasts ?

#

what would that do

misty current
#

the direction in which the entities are looking

#

the player has one of those lines sticking out of its eyes

lost matrix
misty current
#

anyways there are probably entities riding the player

tardy delta
wary harness
#

don't tell any one

tardy delta
#

😳

wary harness
#

I am trying to figure out how they hide back pack in firstperson mode

#

so this could be the key

#

how it works

#

things is all other players have armorstands on the top of heads

#

but I don't have one

tardy delta
#

wdym would you see it in first person?

wary harness
#

so I try to recreate backpack

#

I got it working

#

but when u look at floor

#

in first person you can see back pack

tardy delta
#

oh

#

how do they even do it? armorstand?

wary harness
#

and it looks ugly

#

armorstand riding

tardy delta
#

never tried something liek that

quaint mantle
quaint mantle
#

I mean, I don't even know how to insert the skin url in there

misty current
#

make it marker

#

as i had told you

#

ArmorStand#setMarker()

tardy delta
#

does anyone knows how to prevent a file from being deleted in the file explorer or smth related?

lost matrix
tardy delta
#

i looked it up but couldnt find really useful things

quaint mantle
lost matrix
#

?learnjava

undone axleBOT
lost matrix
#

At least the basics

quaint mantle
#

I know the basics, it's just that I have always struggled with writing code without concrete examples

lost matrix
misty current
lost matrix
tardy delta
brave sparrow
#

Nobody should be deleting a db at runtime

lost matrix
brave sparrow
#

There’s only so much you can do about user stupidity

tardy delta
#

stupid users

brave sparrow
#

I wouldn’t worry about it

#

That’s not exactly something they can do by accident

lost matrix
#

rename it "dont-delete-me-you-moron.db"

#

What are you trying to do? Multiple lines above a user?

misty current
#

if someone has full access to the database you can't provide any way to block them from using it entirely

lost matrix
#

You can simply change the name above a players head without using armor stands

quaint mantle
turbid shoal
#

yo i need help

#

can you tell me what to do

misty current
#

try it

tardy delta
misty current
#

if i told you to use marker theres a reason

#

else than the fact that a non marker one would partially block incoming hits

quaint mantle
tardy delta
#

i dont even know a lot of youtubers that write good code

misty current
turbid shoal
#

PLEASE GHELP

i need a 3x3 square of DIFFERENT random slection of these blocks;
Material.DIRT, Material.STONE, Material.COBBLESTONE, Material.LOG, Material.WOOD, Material.BRICK, Material.GOLD_BLOCK, Material.NETHERRACK, Material.ENDER_STONE

everything i have tried doesnt work. whether there are repeating blocks or it just does all the same blocks. PLEASE YO NECESITO AYUDAR

quaint mantle
misty current
#

spigot's api is not the sole and only purpose of java

lost matrix
tardy delta
#

just make some java project

eternal oxide
#

You need Java tutorials not Spigot tutorials

brave sparrow
#

^

tardy delta
#

and after a while look again at it and try to figure out what you could do better

brave sparrow
#

Spigot tutorials are assuming a baseline understanding of Java prior to even beginning

quaint mantle
#

Yeah that's how I write Java as well, I find functioning snippets and adapt them. I just can't seem to understand syntax without seeing an example.

turbid shoal
#

he epic

brave sparrow
#

If you don’t understand the syntax yet then it’s too early to be writing spigot plugins, is what we’re saying

misty current
#

doesn't the fact that you extend JavaPlugin in your main class tell you that you are not ready to use spigot's api if you don't know what does it do

#

why do you use the api if you don't understand what you are coding

quaint mantle
#

Because I wanted to make a plugin.

turbid shoal
lost matrix
turbid shoal
#

yes

misty current
#

it won't make you better but it will make you someone who can kind of understand easy spigot's api code but with fundamental lack of skill, oop and syntax knowledge

lost matrix
quaint mantle
turbid shoal
#

array.shuffle or smthn

misty current
#

iirc Collections has a shuffle method

lost matrix
brave sparrow
#

You can use that, or you can shuffle it manually

turbid shoal
#

how shuffle manually

misty current
#

create an array

turbid shoal
#

can someone write me an example?

misty current
#

call Collections.shuffle(myarray)

#

boom u have shuffled array

#

also google is your friend

turbid shoal
#

naw

#

i use bing

#

😏

brave sparrow
waxen plinth
#

Collections.shuffle(Arrays.asList(array))

quaint mantle
misty current
waxen plinth
#

Not true

#

Collections.shuffle mutates the list you give it in order to shuffle

young knoll
#

It mutates the input collection

waxen plinth
#

Arrays.asList wraps the array in a list

misty current
#

oh right it's not List.of

waxen plinth
#

Calls to the list will modify the array

misty current
#

my brain kind of translated it as calling the arraylist constructor

tardy delta
#

isnt Arrays.asList immutable in some way?

misty current
#

that's List.of

#

array.aslist returns a mutable list that refers to the original array

lost matrix
misty current
#

you can change elements but not extend/reduce the size

misty current
#

well half mutable

#

i meant it's not like list.of

tardy delta
#

ah shuffle only needs the iterator and the underlying array

brave sparrow
#

It doesn’t return an array at all

#

Lol

misty current
#

that returns a completely immutable list

brave sparrow
#

Mutable or otherwise

misty current
#

meant to write list there

tardy delta
brave sparrow
#

why

turbid shoal
#

i can

#

i just done want to

turbid shoal
#

naw

#

there has to be a way

paper viper
#

uh no

lost matrix
#

Why should there be a way for that? How would you even define such a method? With a 3 dimensional array of Materials?

turbid shoal
#

but with like a for loop

paper viper
#

bruh

turbid shoal
#

idk

tardy delta
#

is this java8+ or something?

paper viper
#

you use a loop to set each block individually

#

lmao

paper viper
tardy delta
#

ah wait

paper viper
#

but it seems to be package visibility

tardy delta
paper viper
#

Yea

brave sparrow
#

@turbid shoal minecraft doesn’t expose an array of blocks for you to modify lol

#

You set them inside your for loop but you still have to set each block

turbid shoal
paper viper
#

...

brave sparrow
#

WorldEdit also sets them one at a time

paper viper
#

it still sets each block individually

turbid shoal
#

wtf

#

thats dumb

brave sparrow
#

It’s the only way to do it

turbid shoal
#

i have to do like 81 blocks

paper viper
#

no, you are dumb

#

Lol

#

That's not how stuff works

turbid shoal
#

im not the biggest java expert

brave sparrow
#

for (yada yada yada)
{
b.setType(yada);
}

lost matrix
# turbid shoal could i do ti with worldedit api?
    Block middle = ...;
    int radius = 3;
    
    for (int x = -radius; x <= radius; x++) {
      for (int y = -radius; y <= radius; y++) {
        for (int z = -radius; z <= radius; z++) {
          Block relative = middle.getRelative(x, y, z);
          relative.setType(Material.GOLD_BLOCK);
        }
      }
    }

Thats literally it

tardy delta
#

yada yada yada

#

thats the spiwit

brave sparrow
#

Lol

turbid shoal
#

but how would i change the location for the loop

#

it would set the same location right?

paper viper
#

?

tardy delta
#

Block middle = ...;

paper viper
#

wdym

turbid shoal
#

like i have 81 different locations that i need to set

paper viper
#

are they related?

turbid shoal
#

9 different 3x3 areas

paper viper
#

in any way

tardy delta
#

then loop over that locations?

paper viper
#

Yeah lol

#

Loop through 9 locations

turbid shoal
#

how do i cahgne the location in the loop thoguh

paper viper
#

its called a data structure

turbid shoal
#

im stupid

#

explain

paper viper
#

just create an array, set, list, or whatever of the locations

lost matrix
paper viper
#

then iterate through them

lost matrix
#

^

turbid shoal
#

OH

#

yeah

#

ok

#

im

#

rretad'ded

tardy delta
#

javas variable name choice is pretty neat

waxen plinth
#
Block center;
for (int x = -1; x <= 1; x++) {
  for (int y = -1; y <= 1; y++) {
    for (int z = -1; z <= 1; z++) {
      center.getRelative(x, y, z).setType(Material.STONE);
    }
  }
}```
paper viper
#

lmao

waxen plinth
#

But 3d for loops are pretty tedious to write

#

You should write a helper method or something

tardy delta
#

the Arrays class

waxen plinth
#

I've got it like this

#
CuboidRegion.cubeRadius(center, 1).forEachBlock(b -> b.setType(Material.STONE));```
turbid shoal
#

is that worldedit api?

tardy delta
#

smh

turbid shoal
#

im dumb

paper viper
#

bruh

turbid shoal
#

i am just statityngr

#

g

#

f

#

f

#

thx

waxen plinth
#

No it's my own library

turbid shoal
#

i think im good

waxen plinth
#

But you can pretty easily write your own helper method like that

#

Especially if you learn about lambdas

turbid shoal
#

i dont even know hat that is

waxen plinth
#

Okay then start simple

turbid shoal
#

i think i got it to work

lost matrix
#

Reminds me when i first learned about streams. I found them so cool that i literally did stuff like this

    IntStream.rangeClosed(-radius, radius)
            .forEach(x -> IntStream.rangeClosed(-radius, radius)
                    .forEach(y -> IntStream.rangeClosed(-radius, radius)
                            .forEach(z -> middle.getRelative(x, y, z).setType(Material.GOLD_BLOCK))));
tardy delta
#

that looks so ugly lol

paper viper
#

oh no

#

lol

tardy delta
#

could be me tho 😌

waxen plinth
#
    public List<Block> getInRadius(Block center, int radius) {
        List<Block> blocks = new ArrayList<>();
        for (int x = -radius; x <= radius; x++) {
            for (int y = -radius; y <= radius; y++) {
                for (int z = -radius; z <= radius; z++) {
                    blocks.add(center.getRelative(x, y, z));
                }
            }
        }
        return blocks;
    }```
#

You can do something like this

waxen plinth
#

Then do

#
List<Block> blocks = getInRadius(center, 3);
for (Block block : blocks) {
  block.setType(Material.STONE);
}```
#

Much cleaner than doing a 3d for loop every time

turbid shoal
#

true

#

ok this is very stupid question
but hwo do you reference a specifc array thing within .setType();

waxen plinth
#

What

tardy delta
#

List#forEach kekw

turbid shoal
#

like

tardy delta
#

πŸ˜‚

waxen plinth
#

Yeah but they don't know about lambdas

#

So I'm avoiding that

paper viper
#

ok you need to at least learn how to use loops

#

Lol

waxen plinth
#

If you have a Block[] blocks

paper viper
#

second part

waxen plinth
#

You could do blocks[0].setType(Material.STONE)

turbid shoal
#

no

#

thats not what im askyingh

opal juniper
paper viper
#
for (Block b : blocks) {

}
#

this?

tardy delta
#

ew

turbid shoal
#

like loc1.getBlock().setType(Array[1]);

tardy delta
turbid shoal
#

what do i put ion Array[1]

#

becuase its giving error

paper viper
#

what error?

waxen plinth
#

Do you have an array called Array

paper viper
#

can u show code too

waxen plinth
#

Because if so please don't do that

waxen plinth
#

Yeah show us more code please

turbid shoal
#

its spread out

tardy delta
paper viper
#

not an excuse

#

just make a paste

#

and paste separate classes

turbid shoal
#

this is probalby going to look reallyu sloppy, its legit my first plugin ever ok

#

so

#

yeah

#

how do uyou do the discord formatting thing

opal juniper
#

?paste

undone axleBOT
opal juniper
#

put it there

tardy delta
#

also something

lost matrix
opal juniper
#

its the wrong colour lol

tardy delta
#

grr nvm

turbid shoal
#
List<Material> jigBlocks = Arrays.asList(Material.DIRT, Material.STONE, Material.COBBLESTONE, Material.LOG, Material.WOOD, Material.BRICK, Material.GOLD_BLOCK, Material.NETHERRACK, Material.ENDER_STONE);

Collections.shuffle(Arrays.asList(jigBlocks));

jig1pos1.getBlock().setType(jigBlocks[1]);
#

what am i adoing wrong

tardy delta
#

wait

#

Arrays.asList(jigBlocks)

opal juniper
#

you cant get from a list like that

arctic moth
#
java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getType()" because "result" is null
    at org.bukkit.inventory.ShapedRecipe.<init>(ShapedRecipe.java:46) ~[purpur-api-1.18.1-R0.1-SNAPSHOT.jar:?]
    at me.tristandasavage.bedwars.ItemManager.createLocatorCompass(ItemManager.java:84) ~[Bedwars but not.jar:?]
    at me.tristandasavage.bedwars.ItemManager.init(ItemManager.java:25) ~[Bedwars but not.jar:?]
    at me.tristandasavage.bedwars.Main.onEnable(Main.java:19) ~[Bedwars but not.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[purpur-api-1.18.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[purpur-api-1.18.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[purpur-api-1.18.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugin(CraftServer.java:564) ~[purpur-1.18.1.jar:git-Purpur-1547]
    at org.bukkit.craftbukkit.v1_18_R1.CraftServer.enablePlugins(CraftServer.java:478) ~[purpur-1.18.1.jar:git-Purpur-1547]
    at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:732) ~[purpur-1.18.1.jar:git-Purpur-1547]
    at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:508) ~[purpur-1.18.1.jar:git-Purpur-1547]
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:349) ~[purpur-1.18.1.jar:git-Purpur-1547]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1218) ~[purpur-1.18.1.jar:git-Purpur-1547]
    at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:322) ~[purpur-1.18.1.jar:git-Purpur-1547]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]

any idea why im getting an error for ItemStack.getType() when im not running it lol

lost matrix
#

?npe

opal juniper
#

lol

turbid shoal
delicate lynx
#

purpur-api-1.18.1-R0.1-SNAPSHOT.jar

tardy delta
lost matrix
#

I wish

opal juniper
delicate lynx
#

post the line that is throwing the error

tardy delta
#

kekw

arctic moth
#

anywhere in the functin

turbid shoal
lost matrix
tardy delta
#

?paste the code

undone axleBOT
waxen plinth
#

Cannot invoke "org.bukkit.inventory.ItemStack.getType()" because "result" is null

tardy delta
#

or just figure it out kekw

waxen plinth
#

at org.bukkit.inventory.ShapedRecipe.<init>(ShapedRecipe.java:46)

#

You're passing null to this constructor

arctic moth
arctic moth
#

oh

waxen plinth
#

ShapedRecipe recipe = new ShapedRecipe(locatorcompasskey, locatorcompass);

#

Which one of these is the result

#

Whichever it is, it's null

arctic moth
waxen plinth
#

The recipe

lost matrix
arctic moth
#

oh

#

locatorcompass

delicate lynx
#

I don't see it being defined anywhere here

arctic moth
#

its defined earlier

tardy delta
#

where are locatorcompasskey and locatorcompass coming from?

arctic moth
#

public static ItemStack locatorcompass;

#

public static final NamespacedKey locatorcompasskey = new NamespacedKey(Main.plugin, "locatorcompass");

delicate lynx
#

that is not being defined

waxen plinth
#

Well there's your issue

#

locatorcompass is null

tardy delta
#

did you initialize the itemstack?

#

prob not

arctic moth
waxen plinth
#

BELOW where you create the recipe

arctic moth
#

oh

#

i forgor

tardy delta
#

ItemStack lc = new ItemStack(Material.COMPASS);

arctic moth
#

to change the variable that it sets to

#

my bad

#

xD

waxen plinth
#

Man this is a mess

#

You have 3x locatorcompass

arctic moth
#

ik

waxen plinth
#

locatorcompass, locatorcompass2, locatorcompass3

delicate lynx
#

why not name it the correct tiers

arctic moth
#

some asshole wanted it like that

waxen plinth
#

You never actually set the locatorcompass variable

arctic moth
#

locatorcompass = lc;

#

lol

#

i just put the wrong variable

#

πŸ€¦β€β™‚οΈ

turbid shoal
#
[22.02 14:57:13] [Server] [WARN] java.lang.IllegalStateException: Asynchronous block remove!

??????????????????????

#

what does this mean

#

arror in console

waxen plinth
#

Means you're removing a block and you're not doing it on the main thread

young knoll
#

You are removing a block async

tardy delta
#

are you doing stuff async?

brave sparrow
#

You’re modifying something off the main thread

#

Lol

turbid shoal
#

so?

#

why canty i do that

brave sparrow
#

Minecraft doesn’t allow that

young knoll
#

So you can't do that

waxen plinth
#

PSA: if you want help, show some goddamn code and the full error

brave sparrow
#

It’s not thread safe

tardy delta
#

go back to the main thread using Bukkit.getScheduler().runTask(plugin, () -> {})

turbid shoal
#
[22.02 14:57:13] [Server] [WARN] Exception in thread "Timer-53" 
[22.02 14:57:13] [Server] [WARN] java.lang.IllegalStateException: Asynchronous block remove!
[22.02 14:57:13] [Server] [WARN]     at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:14)
[22.02 14:57:13] [Server] [WARN]     at net.minecraft.server.v1_8_R3.Block.remove(Block.java:317)
[22.02 14:57:13] [Server] [WARN]     at net.minecraft.server.v1_8_R3.Chunk.a(Chunk.java:536)
[22.02 14:57:13] [Server] [WARN]     at net.minecraft.server.v1_8_R3.World.setTypeAndData(World.java:396)
[22.02 14:57:13] [Server] [WARN]     at org.bukkit.craftbukkit.v1_8_R3.block.CraftBlock.setTypeIdAndData(CraftBlock.java:137)
[22.02 14:57:13] [Server] [WARN]     at org.bukkit.craftbukkit.v1_8_R3.block.CraftBlock.setTypeId(CraftBlock.java:130)
[22.02 14:57:13] [Server] [WARN]     at org.bukkit.craftbukkit.v1_8_R3.block.CraftBlock.setType(CraftBlock.java:121)
[22.02 14:57:13] [Server] [WARN]     at org.bukkit.craftbukkit.v1_8_R3.block.CraftBlock.setType(CraftBlock.java:116)
[22.02 14:57:13] [Server] [WARN]     at com.chapster.pgp.commands.Jigsaw$3.run(Jigsaw.java:101)
[22.02 14:57:13] [Server] [WARN]     at java.util.TimerThread.mainLoop(Timer.java:555)
[22.02 14:57:13] [Server] [WARN]     at java.util.TimerThread.run(Timer.java:505)
waxen plinth
#

And the code

brave sparrow
#

Minecraft requires all the game logic to be on the main thread

#

You can’t change the world state async

lost matrix
arctic moth
#

lol

waxen plinth
#

Guys you're all saying the same thing but I feel like he doesn't even know what a thread is

turbid shoal
#

it shows error when it gets tio this

new java.util.Timer().schedule(
                    new java.util.TimerTask() {
                        @Override
                        public void run() {

                            Collections.shuffle(Arrays.asList(jigBlocks));

                            jig1pos1.getBlock().setType(jigBlocks.get(0));
                            jig1pos2.getBlock().setType(jigBlocks.get(1));
                            jig1pos3.getBlock().setType(jigBlocks.get(2));
                            jig1pos4.getBlock().setType(jigBlocks.get(3));
                            jig1pos5.getBlock().setType(jigBlocks.get(4));
                            jig1pos6.getBlock().setType(jigBlocks.get(5));
                            jig1pos7.getBlock().setType(jigBlocks.get(6));
                            jig1pos8.getBlock().setType(jigBlocks.get(7));
                            jig1pos9.getBlock().setType(jigBlocks.get(8));

                            player.sendMessage(ChatColor.GREEN + "GO");

                            player.getInventory().setItem(0, dirt);
                            player.getInventory().setItem(1, stone);
                            player.getInventory().setItem(2, cobble);
                            player.getInventory().setItem(3, log);
                            player.getInventory().setItem(4, plank);
                            player.getInventory().setItem(5, bricks);
                            player.getInventory().setItem(6, gold);
                            player.getInventory().setItem(7, netherrack);
                            player.getInventory().setItem(8, endstone);

                            blockPlaceToggle = true;
                        }
                    },
                    2100
            );
waxen plinth
#

Yeah why are you doing that

tardy delta
#

even a timer lol

turbid shoal
#

what is wrng with that

delicate lynx
#

bruh

waxen plinth
#

.-.

tardy delta
#

something tells me that this is stackoverflow

turbid shoal
#

ITS MY FIRST PLUGINS

#

ITS MY FIRST PLUGINS

#

ITS MY FIRST PLUGINS

#

ITS MY FIRST PLUGINSITS MY FIRST PLUGINS

#

ITS MY FIRST PLUGINS

#

ITS MY FIRST PLUGINS

#

ITS MY FIRST PLUGINS

#

ITS MY FIRST PLUGIN

tardy delta
#

dont spam

waxen plinth
#

Quit fucking spamming holy shit

brave sparrow
#

For the last time

delicate lynx
#

now you are spamming and looking even worse

turbid shoal
brave sparrow
#

You cannot modify the world state in minecraft off the main thread

waxen plinth
#

Are you trying to delay something to run later

#

If so just use

tardy delta
#

youre just learning stuff it doesnt matter, just try to understand things

brave sparrow
#

Use the Bukkit scheduler not Timer

lost matrix
#

?scheduling

undone axleBOT
waxen plinth
#
Bukkit.getScheduler().scheduleSyncDelayedTask(pluginHere, () -> {
  // whatever you want to happen
}, delay);```
#

delay is in ticks

#

So if you want it to delay by 5 seconds, that's 100 ticks

tardy delta
#

also i dont know why Arrays.asList(jigBlocks)

delicate lynx
#

if you want to schedule things, never use timer, use the bukkit scheduler

turbid shoal
#

ok yeah i was trying to find scheduler but spuigot forums didnt help

tardy delta
#

while jogBlocks is already a list

turbid shoal
#

so i just used java

brave sparrow
#

Java uses another thread to do it

turbid shoal
#

so is the scheduler the problem?

brave sparrow
#

Yes

delicate lynx
#

yes

turbid shoal
#

kthx

#

:}

arctic moth
#

is there a way to make things stackable/unstackable

waxen plinth
#

You mean items?

arctic moth
#

wait nvm its already an unstackable item i just fucked something up

waxen plinth
#

Ok

arctic moth
#

xD

waxen plinth
#

If you want to make an item unstackable the easiest way is to give each one a random piece of metadata so that they're slightly different and can't stack

#

You can't really make unstackable items stackable

waxen plinth
tardy delta
#

kekw

waxen plinth
#

I don't use the scheduler methods anymore I just do

turbid shoal
#

20 ticks in second right?

waxen plinth
#

Yes

turbid shoal
#

epic

tardy delta
#

created your own methods?

waxen plinth
#
Task.syncDelayed(() -> {
  // code
}, delay);```
#

Yeah

opal juniper
#

πŸ€“

tardy delta
#

ah saw that in other plugins too

turbid shoal
opal juniper
#

dont use that

turbid shoal
#

ok

opal juniper
#

if you dont understand what is happening

tardy delta
#

it just doesnt the same thing inside the method

waxen plinth
#

^^^

opal juniper
#

and you dont have access to that

waxen plinth
#

I'm always the first one to plug my library but you really shouldn't use it until you have a solid grasp of java

arctic moth
turbid shoal
waxen plinth
#

No you can do it anywhere but you need a reference to the plugin

waxen plinth
turbid shoal
#

when i reference to the plugin it gives error

waxen plinth
#

You have to do stuff like this

arctic moth
turbid shoal
#

"expression unexcpected"

arctic moth
#

why the hell am i saying my bad so much today

waxen plinth
#
ItemStack item; // Assume this is set
ItemMeta meta = item.getItemMeta();
meta.setLore(List.of("a", "b"));
item.setItemMeta(meta);```
arctic moth
#

yep ik

waxen plinth
delicate lynx
#

are you allergic to variable names

turbid shoal
#

Bukkit.getScheduler().scheduleSyncDelayedTask(PGP, () -> {

waxen plinth
#

PGP is probably the class name

#

You need the plugin instance

#

Which you can do a number of ways

turbid shoal
#

its the name of the plkugins

waxen plinth
#

Could do Bukkit.getPluginManager().getPlugin("PGP")

#

Could do JavaPlugin.getProvidingPlugin(PGP.class)

#

Could make a static instance getter

#

Oh right my bad lol

quaint mantle
#

(Constructors exist)

waxen plinth
#

But you have to understand why the original did not work

#

PGP is not a value, it's a class name

#

A type

turbid shoal
#

its not a class

waxen plinth
#

PGP.class is an object representing the PGP class

#

You need the PGP instance

#

Not the class and not the typename

turbid shoal
#

ITS NOT A CLASS

waxen plinth
#

...

tardy delta
#

whats even the difference between #getPlugin and #getProvidingPlugin

turbid shoal
#

there is no class names PGP

#

named

waxen plinth
#

Okay

delicate lynx
#

then why did you put PGP as the plugin instance

waxen plinth
#

Well what are you expecting then

turbid shoal
#

because PGP is the name of the plugin

waxen plinth
#

The language doesn't know what you mean when you just type PGP

#

But you still need the instance

delicate lynx
#

you need the instance not the name of it

waxen plinth
#

I bet he named his class Main

turbid shoal
#

waht does instance mean

delicate lynx
#

oh boy

turbid shoal
#

IM TROLLING

#

jk

#

lol