#help-development

1 messages · Page 1365 of 1

rocky glacier
#

Does anyone have experience with Protocollib and armorstands with custom names?

lost matrix
#

Sounds a bit like hell if you dont use nms for that...

rocky glacier
#

it is a bit of a hell thats been goign on for a few hours now

#

I get visibility packets to work, but not the customname

lost matrix
#

Faking the DataWatcher alone seems like a ton of work at first glance...

rocky glacier
#
WrappedDataWatcher watcher = new WrappedDataWatcher();
        //watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(0, WrappedDataWatcher.Registry.get(Byte.class)), (byte)0x20);
        //watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(2, WrappedDataWatcher.Registry.get(String.class)), "{\"text\": \"TEST\",\"bold\": \"false\", \"extra\": {}}");
        //watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(2, WrappedDataWatcher.Registry.get(String.class)), "test");
//        watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(2, WrappedDataWatcher.Registry.getChatComponentSerializer()),
//                WrappedChatComponent.fromText("TESTTT!!").getHandle());
        watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(2, WrappedDataWatcher.Registry.getChatComponentSerializer()),
                WrappedChatComponent.fromChatMessage("TESTTT!!")[0]);
        watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(3, WrappedDataWatcher.Registry.get(Boolean.class)), true);
        watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(5, WrappedDataWatcher.Registry.get(Boolean.class)), true);
        watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(11, WrappedDataWatcher.Registry.get(Byte.class)), (byte) (0x08 | 0x10));
#

the first one with index = 0 is visibility (the 0x20 byte)

lost matrix
#

What version are you on?

rocky glacier
#

that works so the entityid works fine, but you can see all the iterations ive done with custom names

#

1.16.5

lost matrix
#

Ok

rocky glacier
#

Would you by chance have any idea what I could do

lost matrix
#

In many cases metadata packets fail because the entity ids do not match up so the client just throws the packet away.

rocky glacier
#

I did think of that but then why does the visibility packet work

#

Right

lost matrix
#

Have you tried just spawing the ArmorStand as marker instead of making it invisible?

rocky glacier
#

Ill get rid of all the watcher objects and just leave the marker instead

rocky glacier
lost matrix
rocky glacier
#
watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(14, WrappedDataWatcher.Registry.get(Byte.class)), (byte) (0x10));

Can you confirm that this is correct?

#

Bc nothing is really happening now, its just a plain armorstand

#
  • Maybe I should show you the spawnentityliving packet too
#
        PacketContainer packetSpawnEntity = new PacketContainer(PacketType.Play.Server.SPAWN_ENTITY_LIVING);

        packetSpawnEntity.getUUIDs()
                .write(0, usingUUID);

        packetSpawnEntity.getBytes()
                .write(0, (byte)yawRad);

        packetSpawnEntity.getIntegers()
                .write(0, entityId)
                .write(1, 1);

        packetSpawnEntity.getDoubles()
                .write(0, location.getX())
                .write(1, location.getY())
                .write(2, location.getZ());

        try {
            protocolManager.sendServerPacket(player, packetSpawnEntity);
            Bukkit.broadcastMessage("sent1");
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }

        PacketContainer packetModifyArmorstand = new PacketContainer(PacketType.Play.Server.ENTITY_METADATA);

        //Bukkit.broadcastMessage(packetModifyArmorstand.getWatchableCollectionModifier().getFields().toString());

        WrappedDataWatcher watcher = new WrappedDataWatcher();
        watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(14, WrappedDataWatcher.Registry.get(Byte.class)), (byte) (0x10));

        packetModifyArmorstand.getWatchableCollectionModifier().write(0, watcher.getWatchableObjects());
        packetModifyArmorstand.getIntegers().write(0, entityId);

        try {
            protocolManager.sendServerPacket(player, packetModifyArmorstand);
            Bukkit.broadcastMessage("sent2");
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }
#

entityId is just a random integer right now

#

maybe thats why it doesnt work?

lost matrix
#

If you keep track of that int and re-use it in other packets then it should be fine.

rocky glacier
#

Yes thats what i do 🙂

lost matrix
#

Ill have to read the protocol specification again to validate this packet.

rocky glacier
#

I could send it to you if youd like

lost matrix
rocky glacier
#

Yes thats the protocol for spawning

#

Here's the meta data packet

lost matrix
#

Ok the spawn packet looks alright so far

rocky glacier
#

Yeah thats working as expected

quaint mantle
#

wait so whats wrong with it

#

like what do u want the armorstand to have

rocky glacier
#

A custom name

quaint mantle
#

what version r u using btw

rocky glacier
#
watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(2, WrappedDataWatcher.Registry.get(String.class)), "test");
watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(3, WrappedDataWatcher.Registry.get(Boolean.class)), true);
``` Something like this doesnt work
#

1.16.5

quaint mantle
#

im pretty sure it changed a couple versions ago to some kind of chat component bullshit

#

let me check

rocky glacier
#
watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(2, WrappedDataWatcher.Registry.getChatComponentSerializer()),
                WrappedChatComponent.fromText("TESTTT!!").getHandle());

#

Is this what you mean @quaint mantle

quaint mantle
#

yeah i think so

rocky glacier
#

Still no result 😦

quaint mantle
#

give me a sec

rocky glacier
#

Thanks

lost matrix
#

Try just setting the objects like the marker byte by index pure.
So watcher.setObject(14, (byte) 0x10);

rocky glacier
rocky glacier
lost matrix
#

Then index 2 is of type OptChat. This will screw up stuff quickly so we will look that up last.
Then the third value you need is index 3 boolean=true
So watcher.setObject(3, true);

rocky glacier
#
java.lang.IllegalArgumentException: You cannot register objects without a watcher object!
        at com.comphenix.protocol.wrappers.WrappedDataWatcher.setObject(WrappedDataWatcher.java:399) ~[?:?]
        at com.comphenix.protocol.wrappers.WrappedDataWatcher.setObject(WrappedDataWatcher.java:409) ~[?:?]
lost matrix
#

Right makes sense.

rocky glacier
#

I will be right back ~ 5 mins

quaint mantle
#

try using WrappedDataWatcher.Registry.getChatComponentSerializer(true)

#

instead of WrappedDataWatcher.Registry.getChatComponentSerializer()

#

your string (your custom name) will then need to be wrapped in an optional

rocky glacier
#
watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(2, WrappedDataWatcher.Registry.getChatComponentSerializer(true)),
                Optional.of(WrappedChatComponent.fromText("TESTTT!!").getHandle()));
        watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(3, WrappedDataWatcher.Registry.get(Boolean.class)), true);
#

like this

#

Lets try

#

You're a hero @quaint mantle

#

That was it

quaint mantle
#

Np

rocky glacier
#

@lost matrix Also thanks so much for your effort

feral ridge
rocky glacier
#

What is the question @feral ridge

chrome beacon
#

Programmed Java but never used dependencies?

feral ridge
rocky glacier
lost matrix
# rocky glacier <@!220605553368498176> Also thanks so much for your effort

Im this far right now:

    final PacketContainer metaPacket = new PacketContainer(Server.ENTITY_METADATA);
    final WrappedDataWatcher dataWatcher = new WrappedDataWatcher();

    WrappedChatComponent chatComponent = SomeSheit
    dataWatcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(2, WrappedDataWatcher.Registry.getChatComponentSerializer(true)), chatComponent);
    dataWatcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(3, WrappedDataWatcher.Registry.get(boolean.class)), true);
    dataWatcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(14, WrappedDataWatcher.Registry.get(byte.class)), (byte) 0x10);

    metaPacket.getIntegers().write(0, entityID);
    metaPacket.getDataWatcherModifier().write(0, dataWatcher);
rocky glacier
#

@lost matrix ay.ngel helped me to a solution already. it was the following:

PacketContainer packetModifyArmorstand = new PacketContainer(PacketType.Play.Server.ENTITY_METADATA);

        WrappedDataWatcher watcher = new WrappedDataWatcher();


        watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(2, WrappedDataWatcher.Registry.getChatComponentSerializer(true)),
                Optional.of(WrappedChatComponent.fromText("TESTTT!!").getHandle()));
        watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(3, WrappedDataWatcher.Registry.get(Boolean.class)), true);

        packetModifyArmorstand.getWatchableCollectionModifier().write(0, watcher.getWatchableObjects());
        packetModifyArmorstand.getIntegers().write(0, entityId);
#

@lost matrix The trick was to use a chatcomponenserializer with an optional

lost matrix
#

I was just thinking about how the optional part of OptChat was structured.

#

But nice 👍

rocky glacier
#

Thanks for your effort dude

quaint mantle
#

have fun coding bro

vestal dome
#

So uhm, I'm trying to create a world generation

#

and I want to create the biome generation, does anyone have an idea on how to do that

rocky glacier
vestal dome
#

using a perlin world generation is like trying to draw a number from a drawer.

lost matrix
lost matrix
vestal dome
#

ugh, do you have an idea on how to actually do that.

#

because I don't

rocky glacier
#

If youre just looking into world generation, there are plenty of javascript implementations of that. Im sure that with some practise you can make it into minecraft

rocky glacier
#

Theres lots of videos on youtube thats what i mean

#

They show their perlin noise code, you could copy part of that

outer crane
#

also a lot of unity stuff

#

from the minecraft clones

lost matrix
lost matrix
vestal dome
#

but why from 0 to 1.

lost matrix
#

Thats just the nature of noise generation. You can multiply it by 5000 if you feel like it. Then the values are from 0.0 to 5000.0

vestal dome
#

uhu

#

so I should use various PerlinNoiseGenerators.

#

to determine the biome.. right?

lost matrix
#

Thats up to you. One could be enough. But you could also create an arbitrarily complex system where you have 2 noises for humidity 1 for average temperature, 1 for continents, 1 for geographical composition
and then calculate a thousand different biomes from that.

vestal dome
#

uhu

#

can you show me a quick example?

lost matrix
#

Im actually not sure how to give a visual representation of that... but ill try.

vestal dome
#

Okay.

cold tusk
#

Can anyone help me with this problem? I have a BungeeCord server set up but when I start it I get this error message.

vestal dome
#

run it thru a yaml validator..

lost matrix
#

So you generate multiple 2D arrays of doubles with the simplex noise. Then you evaluate what type of biome should be generated at that position. The actual implementation of those array values is up to you. This example was made using "humidity" and "temperature" just because i felt like it...

cold tusk
chrome beacon
#

Yea no

lost matrix
#

This is from an old game i wrote in java a long time ago.
It also uses OpenSimplexNoise to generate mountains and determines where resources could be found. So a 2D array of my tiles and if the value was >0.8 then some resource is placed there.

chrome beacon
#

That won't happen if it's valid

vestal dome
#

Simplest question of your life

#

Do I just combine the values?

#

with "+" signs?

lost matrix
#

Thats completely up to you. The implementation could be
If temp is between 0.8 and 1.0 and humidity is low (lets say below 0.2) then you generate a desert.
If the temp is high and the humidity is high then you generate a tropic forest. And so on.

#

You could also just create one noise for the beginning and just have 10 biomes that are generated
0.0 -> 0.1 Biom A
0.1 -> 0.2 Biom B
0.2 -> 0.3 Biom C
and so on

vestal dome
#

hmmm

#

very interesting

#

another question, that is kinda important

lost matrix
vestal dome
#

does frequency, octaves & amplitude have anything to do with this?

#

if yes, how should I change them

lost matrix
#

Kind of. Your amplitude is the maximum value that is reached. Working with doubles from 0 to 1 is perfectly fine. But you can alter those values by simply scaling each value.
The frequency changes how "stretched" the noise is generated. So in your case it would define how far certain biomes stretch. So high frequency means only small biome groups and high frequency means large groups of chunks with the same biome.

#

octaves is just the offset. This would be set by just adding a value to each tile. But "frequency" and "octaves" just add to the readability for the human. You can get away with just altering the frequency and working with values from 0 to 1

eternal oxide
#

Procedural generation is complex. You have to really understand random number generation and instancing so you can generate the exact same thing from the same seed every time.

vestal dome
#

uhu

#

alright

#

thanks for all the explanations!

#

pretty satisfied tbh

elfin pilot
#

so

#

question

#

i am trying to keep entities in a list

#

simple ArrayList of LivingEntities

lost matrix
#

Dont

#

Sry. Keep on.

elfin pilot
#

if there's a better way of keeping track of creatures which are currently spawned i am completely open to suggestions

lost matrix
#

What do you need a List of currently spawned LivingEntities for?

elfin pilot
#

i have a 'name plate' mechanic

quaint mantle
#

they're gonna despawn naturally tho under vanilla conditions

#

then just mark the ones u give a nameplate to

#

keep track of their uuid if you give them a nameplate

#

then again, i dont think you need a list

elfin pilot
#

the entities are cleared if no players are within around 30 or so blocks, and there is a hard limit to how many 'nameplated' mobs can be spawned in the world

#

hmm

#

i could use PersistentDataContainer to store extra information

#

that way if the entity happens to despawn, it doesn't really matter if the data is lost

lost matrix
# elfin pilot i have a 'name plate' mechanic

Using the PersistentDataContainer of those entities and listening for ChunkLoad/ChunkUnloadeEvents & EntitySpawn/EntityDespawn or death events should be enough to add/remove the name plates.
No need to keep track of them. Also lists are really bad collections if you use remove or contains often on them.

eternal night
#

*arraylists

elfin pilot
#

hmmmm, alright

lost matrix
# eternal night *arraylists

I dont know any list implementations that scale O(1) on those operations. There might be one ordered implementation where you have O(log(n)) because of binary search capabilities but then the adding suffers.

eternal night
#

insert at last on a linked list is O(1)

#

remove isn't

lost matrix
#

But LinkedLists are trash anyways. The only reason why i would use them is for the constant time removal or insertion operations while iterating.

lilac dagger
#

hi, anyome knows where i can find a deobfuscated minecraft server jar?

lost matrix
lilac dagger
#

that's what i'd hoped i skiped

eternal night
ivory sleet
#

Yeah

eternal night
#

Queues for example

#

like, do those with an array list and you are just brain dead

lost matrix
#

Name one and the answer is almost always ArrayDeque is just better

eternal night
#

array deque lol

lilac dagger
#

when you don't to want jitter when adding or removing

#

like growing the internal array

#

it can be pretty expensive

paper viper
#

it's quite expensive when it gets bigger

lilac dagger
#

but otherwise arrays will always be better due to their better memory usage

lost matrix
#

choose the right growth factor. And its actually faster than one would think.

lilac dagger
#

yes cause of system array copy

#

but still depends

eternal night
#

"choose the right growth factor" seems like a fun task tho

paper viper
#

doesn't system array copy use native shit?

lilac dagger
#

yes

lost matrix
#

ThreadLocalRandom.nextInt() should suffice

paper viper
#

yeah thats what i thought

lost matrix
#

But i remember the days where i benchmarked a ton of javas collections and came to the conclusion that LinkedLists are just slow and bloated. Speaking of CPU time and memory footprint.

lilac dagger
#

blame the class footprint tho

sharp bough
#

could someone explain me what

Material.GRAY_STAINED_GLASS,1,(byte) 15);

is in

ItemStack nothing = new ItemStack(Material.GRAY_STAINED_GLASS,1,(byte) 15);```
#

the byte 15 is what i dont get

lost matrix
#

The iteration for example. 5-10 times slower than ArrayLists. Probably comes from the fact that arrays occupy a consecutive memory address space and thats just nicer to access.

lost matrix
eternal night
#

isn't it still calling ItemStack(Material,int)

lilac dagger
#

oh wow, the iteration is slower as well?

#

i never knew that

lost matrix
eternal night
#

oh, I didn'T see the 1

#

lol

sharp bough
lilac dagger
#

it was a time when a material name has ids to display versions of that material

eternal night
#

throw it away then

lilac dagger
#

like there was only a door

#

and variations of it were numbered

lost matrix
sharp bough
#

oh

eternal night
#

(byte) 15 defined the black variant of colourable blocks (e.g. wool or glass)

sharp bough
#

what do you think i should use instead?

eternal night
#

Material.BLACK_STAINED_GLASS

#

I'd imagine

vestal dome
#

7smile7?

#

is this supposed to give a value higher then 1?

lilac dagger
#

that's just the amplitude of a wave

vestal dome
#

I didn't get it

lilac dagger
#

i suppose it's how high your pattern can go

quaint mantle
#

is there an easier way of what I'm doing

#

I'm manually writing out multiverse perm nodes in the plugin yml to disable the stupid tab auto complete even without perms

eternal oxide
#

no

quaint mantle
#

pain

#

why didn't they just do it

#

like tf

eternal oxide
#

probably created before tab complete was a thing. and no one put perms in their plugin.yml

quaint mantle
#

should upload this somewhere so anyone who needs it could get it

vestal dome
lilac dagger
#

you did it

vestal dome
#

I didn't

lilac dagger
#

0 is the min

#

1 is the max

vestal dome
#

"-3"

#

sense apsent

lilac dagger
#

i suppose it's a sin wave then

#

which goes to negative

#

what about trying 0?

vestal dome
#

kinda worked

#

tho the 3 values it generates, are always, ALWAYS exactly the same between all of them.

#

this is the code...

#

I gotta go to sleep,

#

if someone wants to help me

#

just ping me in your answer so I can use the "mentions" tab in discord, thank you, good night

#

dying inside

sullen marlin
#

Wouldn't be surprised if they're all the same at 0,0

#

Test elsewhere

vestal dome
#

Wym

viscid dune
#

can i ask quest about skript here to ?

unreal quartz
#

sure, but no one here will be able to help you

#

they probably have their own server

merry kindle
#

Im trying to make it so i can set player permission what am i doing wrong?java PermissionAttachment attachment = player.addAttachment(AntasianGUI.getInstance()); attachment.setPermission(race.get(player), true); AntasianGUI.getInstance().perms.put(player.getUniqueId(), attachment); player.closeInventory(); player.sendMessage("You are now " + race.get(player)); for (PermissionAttachmentInfo perm : player.getEffectivePermissions()){ Bukkit.broadcastMessage(perm.getPermission() + ""); } It brodcast that i have the permission in chat but when i do /lp editor it doesn't show there. I want it to work with multiple Permissions plugin other then LuckPerms so simply using there api is sadly not an answer

eternal oxide
#

if a permission check returns true then you are fine. It won;t show up in the lp editor because its not a permission assigned by lp

viscid dune
#
on respawn:
    if "%region at player%" contains "medievalpvp in world hub":
        wait 1 tick
        player command "/warp jungle" 
```someone knows why this not works it reload succes
slim magnet
#

ArmorStand frame = location.getWorld().spawn(location, ArmorStand.class);

#

Does .spawn spawn it in the yaw of location?

#

Or just the x y z

eternal oxide
#

yaw too

tight coyote
#

not sure if you mean pitch @eternal oxide

eternal oxide
#

yaw is rotation, pitch is up/down

tight coyote
#

He aksed about yaw and you said "yaw too"

#

not sure if you meant pitch

eternal oxide
#

fixed 🙂

tight coyote
#

Ah

slim magnet
#

How do I detect when a player walks through or on an Armorstand

vocal shuttle
#

when I build my plugin it is not building the plugin.yml what should I do?

quiet hearth
#

Im trying to make a plugin that gives effects when a player consumes somethings... I set this up and it run, but when I eat something, nothing happens

unreal quartz
#

compare with ==

eternal oxide
#

getItem() returns an ItemStack, you can't compare that to a material

unreal quartz
#

that too

quiet hearth
quiet hearth
#

with ==

unreal quartz
quiet hearth
#

thanks you two

tough zephyr
#

I'm surprised your IDE didn't warn you?

#

Intellij's normally pretty good for warning you about impossible stuff

#

Probably because it's equals though

unreal quartz
#

it did

eternal oxide
#

it wouldn't care as it was attempting an Object comparison.

tough zephyr
#

You'd be surprised. Intellij has warned me about some crazy things before lol

#

It analyzes the code

eternal oxide
#

Eclipse is dumber and lets you do whatever you want 🙂

unreal quartz
#

well in this case their ide did warn them, they just didn't listen

eternal oxide
#

ah

tough zephyr
#

Ah is that what the yellow is

#

I figured it was highlighted by him

#

200 IQ intellij strikes again

#

IMAGINE using Eclipse.

eternal oxide
#

I can;t see SS very well. Too damn small

unreal quartz
#

this is the tooltip, a simple read would've gone a long way

eternal oxide
#

You leave me and my Eclipse alone. We love each other!

tough zephyr
#

Yeah ALWAYS read that stuff @quiet hearth

#

Intellij will prevent so many fucking bugs

eternal oxide
#

But bugs make you a better programmer. When you spend two days trying to fix a stupid issue you definitely remember it the next time.

tough zephyr
#

Not true. Been programming for 10 years now, still make stupid mistakes

eternal oxide
#

over 30 here and I do too, but not as many.

tough zephyr
#

It's just a minor accident sometimes

#

I mean all of SSL was compromised due to a tiny mistake

eternal oxide
#

actually almost 40 years now I guess. Time flies when your head is buried in code.

tough zephyr
#

I bet you are a lot happier now with the higher level languages vs disgusting shit like cobol

eternal oxide
#

I remember back in 82 rewriting Z80 asm for a custom Spectrum rom.

#

It was the best time programming ever

tough zephyr
#

They still make you take ASM for CS

#

But it's nothing difficult

eternal oxide
#

we never had compilers, we wrote the mnemonic, then converted that to hex manually

tough zephyr
#

👀

eternal oxide
#

It doesn;t sound fun btu it was. Little notebooks full of snippets of asm for different functions

young knoll
#

We didn’t have ASM

eternal oxide
#

We had ASM but no internet, It all came from books and tech manuals 😉

#

Well, that was after the punch card machines.

young knoll
#

We still write tests on paper

quaint mantle
#

What is the precedence for commands? How can I override WorldEdit's /info command with my own?

random epoch
#

‘PlayerCommandPreprocessEvent’ runs before a command is run

quiet hearth
#

is there a way to call another method within a method. Im checking to see if the item in the players inventory is a certain meta, then when the egg in this case is thrown it will hatch a certain thing. However you cant, that ik of, have "event.setHatchingType" and "event.setHatching" within a method of PlayerInteractEvent

dusk flicker
#

Im confused by what you meant...

#

Could you possibly rephrase that?

quiet hearth
#

Where the errors are is what im reffering to

dusk flicker
#

Alright so first of all, you should not have your methods static.

#

And you can't call methods like that when they include a object in the constructor, you would have to include a new instance of the event that you want to call.

quiet hearth
#

Is there an easier way of doing what I am. I am just having a special entity spawn when an egg with a certain meta is thrown

#

when it lands

dusk flicker
#

The best thing I will say is to learn more about Java and the Spigot API in general, but i'll try and clarify this more...

Are you trying for when a player right clicks a egg that where it lands it spawns a custom entity depending on the itemmeta for it?

quiet hearth
#

yes

dusk flicker
#

Okay 1 second gonna wright some psuedo code

young knoll
#

Pretty sure you can just use the throw event and check the held item

dusk flicker
#

Yep

eternal oxide
#

it has an EntityType you can set

dusk flicker
#

Use the throw event, and get the thrown item and compare the itemmeta, then once you have that you should be able to set the target spawn entity.

young knoll
#

You can’t get the throw item, but you can check the item in each hand

eternal oxide
#

Use the event I linked. You can get the egg, and you can set if it will hatch and the type that will hatch

quiet hearth
#

I belive the PlayerEggThrowEvent checks after the egg is thrown

#

I have the link pulled up already

dusk flicker
#

That event has everything you need.

#

Just takes some thinking on how to do it :p

young knoll
#

They usually run before the held item is removed

#

usually

eternal oxide
#

it has a getEgg() method. you can check the meta on that as its still an ItemStack

young knoll
#

No it’s not

eternal oxide
#

actually its an Entity

opal sluice
#

?paste

queen dragonBOT
opal sluice
#

I get a java.util.ConcurrentModificationException

#

But I don't understand why

#

I made sure to not make modifications on the iterator

eternal oxide
#

line 10 removing from teh collection you are looping over

opal sluice
#

It's a copy of the collection

#

not the actual one :/

#
                backup = new HashMap<>(AutoChunkRegenMain.getInstance().getOldChunksMap());
                isRegenerating = true;
                int chunksAmount = 0;
                final List<BukkitRunnable> runnableList = new ArrayList<>();
                
                for(Entry<String, List<String>> entry : AutoChunkRegenMain.getInstance().getOldChunksMap().entrySet())
                {
                    final String worldString = entry.getKey();
                    final World world = Bukkit.getWorld(worldString);
                    final List<String> oldChunks = entry.getValue();
#

it's what is before

eternal oxide
#

use an iterator and you can safely remove.

opal sluice
#

Let's try that

quiet hearth
#
import me.chewie.CustomThrowableEggs.items.ThroweggItems;
import org.bukkit.entity.Egg;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerEggThrowEvent;

public class ThroweggEvents implements Listener {

    
    @EventHandler
    private void playerEggThrowEvent(PlayerEggThrowEvent event) {
        Egg egg = event.getEgg();
        
        if (egg.getItem().getItemMeta() == ThroweggItems.throwEggCreeper.getItemMeta()) {
            event.setHatching(true);
            event.setHatchingType(EntityType.CREEPER);
            
        }
        if (egg.getItem().getItemMeta() == ThroweggItems.throwEggTnt.getItemMeta()) {
            event.setHatching(true);
            event.setHatchingType(EntityType.PRIMED_TNT);
        }
    }

}
#

this doesnt work

eternal oxide
#

check it has meta

#

and comparing meta should be an .equals as its not a primitive nor an enum

quiet hearth
#

ok

eternal oxide
#

You will probably want to test something specific in the meta rather than just comparing the object

young knoll
#

I feel like the meta of the held item won’t be carried over

eternal oxide
#

It probably won;t

#

but do some sysout first to see if it has any meta

young knoll
#

If the event fires before the item is removed you can just check the players hands

eternal oxide
#

true

#

its not cancellable so I'm going to guess it comes after the ItemStack is removed

quiet hearth
#

You know what, I'm gonna scratch this idea for now, and come back to it later when more experienced, sorry for wasting yall's time

eternal oxide
quiet hearth
#

I just wanted to try and make them throwable

eternal oxide
#

I've not used teh spawn eggs. Are they not throwable?

quiet hearth
#

No

#

Must be placed on a block

eternal oxide
#

ah

#

well, you could make them throwable

quiet hearth
#

The regualr spawn eggs?

eternal oxide
#

yes, with a little magic

quiet hearth
#

Cool

#

Not sure how

eternal oxide
#

just detect right click of the player in the interact event. look for a spawn egg in their hand. use player.launchProjectile to fire a normal egg. and set meta on it so when you detect it land in the projectile hit event you then spawn whatever mob the meta says.

quiet hearth
#

Ooo, ill give it a try. Thanks

eternal oxide
#

if you block teh ability to place them too, they can only be used as projectiles

quiet hearth
#

Ok

young knoll
#

You could even make them look like spawn eggs in the air

#

You can set the displayed item on a snowball

quiet hearth
#

Alright

opal sluice
eternal oxide
#

nice

opal sluice
#

Regenerating chunks is so resource heavy god sake

eternal oxide
quiet hearth
#

ok

young knoll
#

And you can still call setItem on it

eternal oxide
#

bummer egg materials are not keyed 😦

young knoll
#

Hmm?

eternal oxide
#

can;t use Tag to detect all spawn eggs

young knoll
#

Ah

#

You can add one via datapack, but I don’t know how well spigot can integrate with that

eternal oxide
#

even SpawnEggMeta is heavily deprecated with no replacements

#

Probably still usable (probably)

young knoll
#

You could use a loop and match any material ending in _SPAWN_EGG

eternal oxide
#

yeah

#

or just a .contains on getType().name()

young knoll
#

That’s the idea, you can populate a set with the loop at startup

eternal oxide
#

um, how to get the EntityType thats spawned by a spawn egg. Seems to be no working method now

sullen marlin
#

?

eternal oxide
#

SpawnEggMeta#getSpawnedType() is deprecated adn just returns Caused by: java.lang.UnsupportedOperationException: Must check item type to get spawned type

#

however teh spawn egg only has a getType for material

#

seems to be no way to reference teh EntityType

spare flicker
#

Is sky node good

sullen marlin
#

Not sure

eternal oxide
#

I'd hate to have to create a cross reference table

sullen marlin
#

What's the use case?

#

API would probably end up having a table, might be an oversight though

eternal oxide
#

adapting them to throwables by detect PlayerInteract, spawning a projectile and adding meta to the projectile so I can either set teh spawned entity type on an egg or handle spawnign on the hit event

#

all is currently possible except no method to get the spawned entity type from the ItemStack

#

worst case I can simply strip _SPAWN_EGG from teh name then do a EntityType match

young knoll
#

Or a lookup map

eternal oxide
#

Yeah, trying to avoid that

#

maps have a habit of needing to be updated

young knoll
#

I’m not sure if all of the item names will match up with the entity names

sullen marlin
#

Issue might be that the meta doesn't have access to the type

#

Can't recall

#

Maybe you could look into it

young knoll
#

If this plugin doesn’t work with dispensers too I’ll be sad

eternal oxide
#

lol

#

I'm only playing with it as someone asked in here and it seemed an interesting and doable project.

young knoll
#

Welp, might be something I need to make now

#

I want to launch spawn eggs out of a cannon

eternal oxide
#

that might be fun

young knoll
#

A lot of things could be fun from dispensers

eternal oxide
#

oh bum. PlayerEggThrowEvent fires the instant launchProjectile is called. No time to set meta 😦

#

yay works

scarlet path
#

Why shouldn't I use static methods instead of dependency injection?

eternal oxide
#

It depends on yoru use case

scarlet path
#

Lets say I want to use a single method within another class should I make that method static or use dependency injection

eternal oxide
#

if that class is a utility class then static is usually fine

scarlet path
#

public static String generateGraph(ArrayList<String> labels, ArrayList<Integer> values, String type) I have been using static but some people are saying dependency injection is the way to go

eternal oxide
#

if that method requires no calls to other classes then static would be fine

#

I don;t see any external calls

scarlet path
#

nvm im stupid XD

#

thanks!

eternal oxide
#

Thats a utility class and would be fine static

#

?paste

queen dragonBOT
eternal oxide
#

Throwable spawn eggs 🙂

young knoll
#

Why not use the in built system with eggs?

eternal oxide
#

the player throw egg event fires as soon as you launch the egg so you don;t have time to set any meta on it to indicate the spawn type

dusty herald
#

simple: edit the meta before it's thrown /s

young knoll
#

What’s wrong with setting it right after it’s launched

eternal oxide
#

you get the projectile from the launchProjectile call

#

as I said you can;t do it after you launch it as the player throw egg event will have already fired

#

you need the meta already on the egg to be able to set teh spawn type for the egg.

young knoll
#

Oh those methods are part of the event

#

Not the egg

#

Weird

eternal oxide
#

I did try with eggs but you simply can;t use teh player throw egg event

#

Yep, not on teh egg

#

event only 😦

young knoll
#

That seems odd

eternal oxide
#

this works with any projectile though and is very simple

young knoll
#

Technically just setting the item is enough to identify the egg, without needing meta

eternal oxide
#

true

young knoll
#

Although I guess another plugin may in theory set a snowball to a spawn egg

eternal oxide
#

Yep, at least this way its almost fool proof

young knoll
#

Wouldn’t pdc be better

#

As it persists

eternal oxide
#

no need as it only set when launched

young knoll
#

Yes but what if the server stops while the projectile is still in the air :p

eternal oxide
#

odds of teh server going down with an egg mid flight is slight

#

and if it does go down odds of teh PDC already having been saved is almost zero

young knoll
#

Doesn’t it get saved on shutdown

eternal oxide
#

yep

#

not on crash though

young knoll
#

True

#

But the projectile would probably be lost in a crash anyway

eternal oxide
#

I'm not actually going to use the code myself. It was just an interesting question someone came in with earlier.

young knoll
#

A lot of things could be fun if you could throw them

#

Like fireballs

eternal oxide
#

fireballs that spawn blazes 🙂

young knoll
#

Or arrows

#

Who needs a bow when you have a really strong arm

eternal oxide
#

🙂

limber dust
#

doesn't mythicmobs have throwable spawneggs XD

eternal oxide
#

no idea

young knoll
#

Welp now I have to make a plugin that lets you throw a bunch of stuff

#

Throw a brick through someone’s window

eternal oxide
#

lol

young knoll
#

Sadly I don’t think player.breakBlock ever became a thing

eternal oxide
#

hah, set the item to a brick and if it hits glass, break it 🙂

#

Vandal plugin

young knoll
#

Yeah I just wish I didn’t have to go into NMS to do it easily

eternal oxide
#

that code I posted woudl do it

#

its literally just setting the item to a brick

young knoll
#

Nah the break block option

#

It’s easier than manually calling a break event, but it requires NMS

eternal oxide
#

the Hit event has a getHitBlock().breakNaturally()

young knoll
#

Yes but that doesn’t respect protection plugins

eternal oxide
#

true

young knoll
#

The NMS method does, and manually firing a break event probably would too

rugged topaz
#

the best way to have a player's inventory transfer between servers is to use a database with base64 data?

#

then i'd like, separate each item by a /?

eternal oxide
#

it depends

#

base64 is only useful if you need it encrypted.

rugged topaz
#

well unfortunately lists don't really exist in sql

dusty herald
#

wouldn't it be encoded Wink

eternal oxide
#

ItemStacks are already serializable so can be passed via almost any method

dusty herald
#

why not just throw it into a json array and push it to SQL as a string

rugged topaz
#

and this is from experience with hypixel's api, where they have an inventory endpoint with gzipped base64 data

#

blegh

#

that sounds messy

dusty herald
eternal oxide
#

encoding to base64 will just make teh data larger

young knoll
#

I’d imagine something non relational would be better here

eternal oxide
#

it really depends on what you mean by transfer between servers

rugged topaz
#

e.g. a server, split amongst 3 different servers because minecraft fr some reason can't handle more than 60 people at once, but i'd need their inventories to be synced between all the servers

young knoll
#

If they are on the same machine you could just use a json file

eternal oxide
#

then yes, sql base64 and store as a blob

rugged topaz
#

an actual database > json

#

whereas json can get corrupted easily

eternal oxide
#

an actual db is not better than json when you are just throwing blobs at it

rugged topaz
#

i'd argue network > hard disk

#

and plus, from my experiences with yml files and ig json, data is actually easily just erased for no reason

#

probably (is) a mistake on my part, but db saved my life

rugged topaz
eternal oxide
#

you would probably be safer using base64 if you push to sql

#

Base64.getEncoder().encodeToString

rugged topaz
#

encode the actual itemstack into base64?

eternal oxide
#

no

rugged topaz
#

but why not

#

and what would i do

eternal oxide
#

there are two ways to do it.

#

one is Inventory#getContents() then serialize the collection, but you will also be including null and AIR slots.

#

the other is loop the collection and storing each ItemStack with its index as a key

rugged topaz
#

that sounds optimal, considering the items would need to be placed into their actual positions, not just filling up the inventory as we go down the row

#

o

#

suggestions?

eternal oxide
#

The second woudl be marginally slower but preferable

#

however restorign it is also slightly slower

#

if you simply store teh collection you can restore it just as easily. but at teh expense of extra data

rugged topaz
#

preferable in which way?

#

size of data? errors that could occur with the former?

#

o you said, lmao i didn't seer

#

so extra data vs speed

lilac dagger
#

why would they base64 it if it get zipped?

#

maybe 'cause of their internal util that does that ? 🤔

#

and they didn't bothered

rugged topaz
#

🤷

crude charm
#

how do I paste a schematic using worldeditapi?

#

I have a schem in the worldedit schematics foler

fringe folio
near aurora
#

Hello, what's the best way to centre the yaw and pitch to the block?

candid galleon
#

You can get the direction by subtracting the location of the player by the blocks location

near aurora
#

Okay thanks 🙂

chrome beacon
crude charm
#
        File file = new File(File.separator + "/worldedit/schematics/house1.schematic");

how do I get the file path for this?

chrome beacon
#

file.getPath()

#

Or getAbsolutePath

fringe folio
crude charm
chrome beacon
#

No that's not how you do it

fringe folio
crude charm
#

no?

chrome beacon
crude charm
#

I tried

#

but I cant find it

#

nvm

chrome beacon
#

._.

crude charm
#

wat

#

ik im dumb

#

ive been up till 5am 4 nights in a row

chrome beacon
#

You need to get the WorldEdit plugin instance

crude charm
#

I did

chrome beacon
#

Where

crude charm
#

OMG

#

IM SO DUMB

#

BRUH

chrome beacon
#

Now use getDataFolder on that

crude charm
#

ik

chrome beacon
#

And remove /worldedit from your path

crude charm
#

yeah I did

unreal kayak
#

this server need a smart bot that upload files to pastebin

crude charm
#

ew

#

pastebin

chrome beacon
#

That's for the idea I'll add that to my bot

quaint mantle
#

Hello! I'm making custom recipe that's with itemstack.

    public void onPlayerCraftItem(PrepareItemCraftEvent e){
        if(e.getInventory().getMatrix().length < 9){
            return;
        }

        ItemStack a = new ItemStack(Material.STONE);
        // setting itemmeta.
        checkCraft(new ItemStack(Material.GRASS) /* It will be custom item instead grass */, e.getInventory(), new HashMap<Integer, ItemStack>(){{
            put(4, a);
        }});
        Bukkit.broadcastMessage("A");
    }

    public void checkCraft(ItemStack result, CraftingInventory inv, HashMap<Integer, ItemStack> ingredients){
        ItemStack[] matrix = inv.getMatrix();
        for(int i = 0; i < 9; i++){
            if(ingredients.containsKey(i)){
                if(matrix[i] == null || !matrix[i].equals(ingredients.get(i))){
                    return;
                }
            } else {
                if(matrix[i] != null){
                    return;
                }
            }
        }
        inv.setResult(result);
    }
``` It doesn't work.
#

i'm trying hard but i don't know what is wrong

#

(Not error on code)

crude charm
#

have you registered it?

quaint mantle
#

yes, broadcastmessage works

#

** Bukkit.broadcastMessage("A");**

round finch
#

where should i go? and what should i do if i wanna learn how to make unique 3D shapes and rotations
as a pretty basic math guy like me

i thinking about block and practicles .. etc
and maybe some java 3d stuff for games

#

.

i were thinking that i should just test and write stuff and code for 3d shapes that i wanted to do in a plugin but i'm pretty sure it will be poorly with lack of propper understanding and it will be a mess

limber dust
quaint mantle
#

Yea, why don't you just create a custom recipe? https://www.youtube.com/watch?v=DZTKu3trOw0

Love the video or need more help...or maybe both?
💬Join us on Discord: http://discord.gg/invite/fw5cKM3
Thank you for tuning in to this episode of TheSourceCode! ❤️

If you enjoyed this video make sure to show your support by liking , commenting your thoughts, and sharing for all your friends to see and learn!

All code is available on Github:
...

▶ Play video
dusty herald
#

TSC kekwhyper

chrome beacon
#

His videos aren't bad

silk mirage
#

can groovy stuff break thread?

#

like when i use groovy along a plugin the plugin freezes

#

what could be the issue?

chrome beacon
#

What are you doing with Groovy

silk mirage
#

im using jda with side of spigot...

unreal kayak
silk mirage
#

with eval command of groovy

chrome beacon
crude charm
#

what is worldedit maven repo?

unreal kayak
#

daysling why r u so active on both jda and spigot xd

silk mirage
silk mirage
unreal kayak
#

use a better bin

silk mirage
#

lmao

#

OKAY LEAVE IT FOR NOW

#

just help me

#

im clueless

unreal kayak
#

I really can't read

#

no highlights

silk mirage
#

hm

unreal kayak
#

or

#

?paste

queen dragonBOT
silk mirage
#

whats the url of ur paste service again?

unreal kayak
silk mirage
#

imagine having a vpn tho, it can't be me ):

unreal kayak
#

xd

silk mirage
crude charm
#

im going to die if 1.16 keeps being broken

#

can someone please help me

chrome beacon
silk mirage
#

@unreal kayak BRROOKEEN

#

omg

unreal kayak
#

I forgot to add bin

#

link is edited

silk mirage
#

wow

unreal kayak
#

open again

#

this is the working one

silk mirage
#

i like ur pastebin theme, but not arc on it

#

lmao

crude charm
#

😀🔫

unreal kayak
crude charm
#

plz help me

#

😢

silk mirage
#

okay now tell what maybe the issue

#

genius

crude charm
#

im using 1.16

#

for like the first time

unreal kayak
#

u just sent the code u didn't tell the issue

silk mirage
crude charm
silk mirage
crude charm
#

this command does not do shit

silk mirage
#

Admin utils keeps on loading

#

it doesn't do anything

#

nor lets the server start

chrome beacon
#

And you're blaming 1.16 md_5

crude charm
#

my command just returns /givehouse

#

I dont normally make commands like this...

unreal kayak
chrome beacon
#

Did you register the command

crude charm
#

yes

#

getCommand("givehouse").setExecutor(this);

silk mirage
unreal kayak
#

oh ur plugin

chrome beacon
unreal kayak
#

so.... it doesn't let the server start

chrome beacon
#

this isn't the GiveHouseCommand class

unreal kayak
#

right?

silk mirage
crude charm
#

I never use spgiot commands

unreal kayak
#

hmm, logs?

#

or give ur main class

#

this class doesn't help

#

or give the source code its the best

silk mirage
#

i mean

#

okay

#

wait

unreal kayak
#

OK let me see

#

what about logs?

silk mirage
#

i can't fetch logs

unreal kayak
#

dude

#

go to ur logs folder and see

silk mirage
#

as i have to kill the server

unreal kayak
#

send me the plugin in dms

crude charm
#

ty\

silk mirage
#

wait a sec

craggy cosmosBOT
dusty herald
#

poor dyno

unreal kayak
#

dyno is thinking slower than humans

#

lol

crude charm
#

lool

silk mirage
#

@unreal kayak Logs ^^

dusty herald
#

1.8.8, TacoSpigot and offline mode

chrome beacon
#

1.8 ;-;

silk mirage
#

it just get stuck on

[08:53:11] [Server thread/INFO]: [AdminUtils] Enabling AdminUtils v1.0-SNAPSHOT
silk mirage
unreal kayak
chrome beacon
#

It can still be 1.16

#

._.

silk mirage
chrome beacon
#

Yes it can

#

oh no

unreal kayak
#

@silk mirage

chrome beacon
#

Cracked server

#

I'm out

unreal kayak
#

does your bot have server member intent enabled?

silk mirage
#

i have privileged intent on..

unreal kayak
#

debug

#

do you know how xd

silk mirage
unreal kayak
#

I said debug

silk mirage
#

but not a good at it

unreal kayak
#

I mean

#

put a console print

#

on first line

#

to make sure onEnable is called

#

then after jda

#

see if it stop before/after jda

#

etc

silk mirage
#

oof

#

thats gonna succ thats what i know

#

lmao

#

im trying with this

unreal kayak
#

sure

silk mirage
#

okay lets try

#

wait

unreal kayak
#

what printed?

silk mirage
#

i think it works on localhost gimme a sec

#

wait wait

#

lemme try again

unreal kayak
#

@silk mirage I noticed you don't reload config before getting the token

#

saveConfig is after the login

silk mirage
#

hmm

#

do i have to?

unreal kayak
#

how can the plugin know the token if it didn't load the config?

silk mirage
#

i mean

unreal kayak
#

huh

silk mirage
#

it gets the token

#

lmao

#

idk why but on localhost it worked

unreal kayak
#

maybe

#

ur server

#

has internet issues

silk mirage
silk mirage
#

i will try to contact jeekie

unreal kayak
#

maybe discord blocked ur server ip

#

i think this is more jda related

unreal kayak
chrome beacon
#

Yea don't support people with cracked servers

crude charm
#
                if (args.length > 0) player.sendMessage(usage());
                if (args.length < 1) player.sendMessage(usage());

why is this not working?

dusty herald
#

what are you try do

chrome beacon
#

Debug

crude charm
#

send if they only type the command and no args

#

and if they type too many args

dusty herald
#

Olivo wanna give me your opinion on my debug log? DogKek

chrome beacon
#

What log?

dusty herald
#

check DM

chrome beacon
#

k

crude charm
#

plz help me 😦

chrome beacon
#

Add some debug messages

#

What you sent us tells us nothing

crude charm
#

ok

vestal dome
quaint mantle
#

Hey how do i make luckperms bungee to stop giving default permissions when players uuid changes

vestal dome
#

You cant

#

Spoiler alert.

#

Make your uuid not change then, which is just using the same name

quaint mantle
#

Well that's a rpboelm

#

Well my plugin changes uuid bcz offlinemode and online mode

#

Well nvm

vestal dome
#

Bungeecord config

#

If you're using bungeecord, enable ip forward and bungeecord at spigot.yml

quaint mantle
#

Well yea but if i enable bungeecord at spigot.yml then the uuid forwards too and its complicated

vestal dome
#

Exactly you want todo that ..

quaint mantle
#

No bcz the uuid will change and the plugins will not recognize it so it will be new data and everything

vestal dome
vestal dome
#

Remove all the player data.

#

And it should work.

quaint mantle
#

No it wouldnt

#

Bcz if you do setOnlineMode true in bungee then the uuid changes to online uuid

#

If you do setonlinemode false then the uuid makes offline uuid

summer scroll
#

Are you using offline mode?

quaint mantle
#

Yes

dusty herald
#

don't expect uuids to be identifiable then

summer scroll
#

I don't think you can do that.

dusty herald
#

you can in bungee config

quaint mantle
#

Yeah ik i was just asking about luckperms

dusty herald
#

I'm sleep now

#

goodnight

quaint mantle
#

Gn

#

In luckperms bungee to not change permissions when uuid changes

#

Well nvm

summer scroll
#

Might have to ask the LuckPerms developer or something.

quaint mantle
#

Yea ig

#

Well ty

#

this crashes my discord

opal juniper
#

Why is my discord crashing?

quaint mantle
#

@sullen marlin sorry for the ping, could you please remove @tulip quest gif? it crashes every discord?

marsh nacelle
#

Is there any way to change a player's username via bungee?

sullen marlin
#

?ban @tulip quest

queen dragonBOT
#

🔨 Banned 101989860197285888 indefinitely

quaint mantle
covert urchin
#

Anybody familiar with WorldGuard API? I'm kind of tired and I can't figure out just how to get the value of a StringFlag on a region 😮

#

region.getFlags().get("my-custom-flag") just returns null 😦

quaint mantle
#

@limber dust @quaint mantle Thanks, but I meant I want to use itemstack instead of material

For example, I don't want to make 1 stick + 3 emerald to make perun
and I want to make 1 perun + 4 admin's stuff to make big perun

#

You can use

#

really?

limber dust
#

Yes

quaint mantle
#

I can only use material

#

Yes

#

No

#

hm

#

New itemstack(Material);

#

oh yeah

#

Xd

#

I want that

#

thanks'

#

Okay

#

Yw

#

ohh

#

What

#

i didn't meant that

#

r.setIngredient('$', Material.STICK);

#

It only able to material

#

😦

#

I want to use itemstack

#

on this

#

        r.shape("#% ", "#$ ", " $ ");
        r.setIngredient('#', Material.DIAMOND);```
#

but thanks for help

drowsy helm
#

use RecipeChoice

quaint mantle
#

thanks everyone P)

#

🙂

vestal dome
#

been trying to fix this for 1 day already.

quaint mantle
#

i have a question

#

how to download spigot so i can make a plugin

quaint mantle
#

You can do maven or just google spigot download

#

idk how to use buildtools

opal juniper
#
@EventHandler
    public static void onInteract(PlayerInteractEvent event){
        Player player = event.getPlayer();
        if(event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK){return;}
        System.out.println(event.getItem());

Why does event.getItem() return null when i am interacting with a stick?

young knoll
queen dragonBOT
quaint mantle
#

hello, spigot, i tried to find recipe symbals chart, but I couldn't found. does everyone know recipe symbal chart?

young knoll
opal juniper
vestal dome
#

uhh

#

what is the problem?

dire marsh
#

you can use any symbol for the recipe choices

#

pattern

vestal dome
#

the item and block can be null, just saying <- interact event

quaint mantle
young knoll
dire marsh
#

yeah you can use anything

young knoll
#

Yeah you can use any character

quaint mantle
#

yea but i want see chart

dire marsh
#

???

quaint mantle
#

not character XD

#

chart

dire marsh
#

you do that further up when you make the recipe

quaint mantle
#

uh ticket?

#

yea

#

I meant chart[graph; diagram]

#

uh

#

like tutorial?

dire marsh
vestal dome
#

(if you're on legacy, the recipe will change, just sayin)

quaint mantle
young knoll
#

Yes you can?

quaint mantle
young knoll
#

recipe.setIngredien(char, new RecipeChoice.ExactChoice)

dire marsh
#

it's right there in the javadocs

quaint mantle
#

thanks everyone

young knoll
#

You have a shapeless recipe

#

So yes, you cannot use recipe.shape

quaint mantle
#

yup, also setingradien

dire marsh
#

then used shapedrecipe

onyx fjord
#

hello

dire marsh
#

hi

onyx fjord
#

is there block data to center sunflower?

#

i want it to be centered

dire marsh
#

no

#

that's just how the game works

onyx fjord
#

oh

#

that sucks lmao

dire marsh
#

I guess

quaint mantle
#

hmm... so can't i fix this?

dire marsh
#

toto, you're using a shapeless recipes

#

shapeless recipes have no shape

quaint mantle
#

oh okay! i understood thanks

#

I understood like

#

(I understood like) you said just use shapedrecipe instead of recipechoice

dire marsh
#

No, use a shapedrecipe instead of shapelessrecipe

quaint mantle
#

okay 😉

lost matrix
#

And a RecipeChoice.ExactChoice instead of a RecipeChoice.MaterialChoice

young knoll
#

Does that work for shapeless recipes now

#

I assume it does

dire marsh
#

it's been draft api for ages...

young knoll
#

Indeed, the docs say it’s only for shaped recipes but I believe it works for furnace recipes too

#

At least

dire marsh
#

Yeah it does

quaint mantle
#

ok thanks, i'll try

#

wait recipe.setIngredient I can only use material 😦

#

it's wired. why only shapless can use itemstack?

#

and cant i use itemstack with shapedrecipe?

dire marsh
#

it's right ther

#

look at the javadocs

young knoll
#

Recipe.setIngredient(new RecipeChoice.exactChoice(item))

quaint mantle
#

ah thanks i'm newbie on javadoc

dire marsh
young knoll
#

Not for shapeless

dire marsh
#

He's using shaped now

#

I think

young knoll
#

Ah

dire marsh
#

also i believe shapeless uses addIngredient

young knoll
#

Probably

rapid vigil
#

I just wanna know what is this warning:
Class 'CLASSNAME' is never used What's the cause?

lost matrix
#

The docs state that exact choices are only supported for shaped recipes but they kind of work for all recipes.

young knoll
#

I assume someone finished the API and never updated it

rapid vigil
#

Intellij

chrome beacon
quiet ice
#

You probably can disable that warning then

chrome beacon
#

Idk

quiet ice
#

IntelliJ loves to go insane with warnings

rapid vigil
#

lol true

#

It doesn't do anything, but I just wanna know what's the cause

chrome beacon
#

Yeah the warnings are great for improving your code

lost matrix
# rapid vigil I just wanna know what is this warning: ```Class 'CLASSNAME' is never used``` Wh...

This means you never create an instance of that class or use its static attributes. So if you would delete the class then the application would run the same.
This is not true for some classes like the one that extends JavaPlugin as its used internally by the spigot class loader.
Those warnings (and the ones where EventHandler methods are being seen as unused) can be suppressed by installing the mcdev plugin for Intellij

rapid vigil
#

Alright, thanks.

sullen marlin
#

What a stupid warnig

vestal dome
#

hm

#

md_5 looking crispy

lost matrix
vestal dome
rapid vigil
#

Alright

sullen marlin
#

Are you doing it at 0,0?

#

Wouldn’t surprise me if they were all the same at the origin

#

Test another point

vestal dome
#

every point is equals

sullen marlin
#

Also amplitude 0 seems questionable

vestal dome
#

hmh

lost matrix
vestal dome
#

master = seed?

sullen marlin
#

Probably the amplitude tbh

#

0 amplitude seems nonsensical

#

Though I’m not familiar with noise

vestal dome
#

I used 0 amplitude since it was giving me a -3 value

#

and I want it to be from 0 to 1

#

as he said

onyx fjord
#

is there block data for berry growth?

lost matrix
#

Thats true. As stated yesterday i would just use an amplitude of 1 and work with 0.0 to 1.0 double floating points

vestal dome
#

it didn't

#

it literally sent a -3 when amplitude was 1.

sullen marlin
#

Check the docs kacper, probably Ageable

onyx fjord
#

kk thanks

quiet ice
#

I use ageable

vestal dome
#

uhm so?

lost matrix
vestal dome
lost matrix
#

Was talking about the PerlinNoiseGenerator but found it

vestal dome
#

I'm using only one

#

since it is still using the same seed.

#

you told that octaves are like "the offset", so I put them way apart..

#

but looks like it didn't really change s***

opal juniper
#

What event listener is it for a player putting an item in chest?

lost matrix
#

Perlin noise != Simplex noise
I have a course now. Ill look into it after that.

lost matrix
opal juniper
#

Ahh, ok

lost matrix
#

and drag

quaint mantle
#

Hello, i having problem with recipe. my code: ItemStack ironIngot = new ItemStack(Material.GRASS_BLOCK); NamespacedKey key = new NamespacedKey(plugin, "reeac"); ShapedRecipe recipe = new ShapedRecipe(key, ironIngot); recipe.setIngredient('E', new RecipeChoice.ExactChoice(ironIngot)); recipe.shape("EEE", "EEE", "EEE");

#

Of course, i searched google, but i couldn't solved

drowsy helm
#

set shape before ingredient

gritty urchin
#

How to check if offline player is actually a real player or not?

quaint mantle
gritty urchin
#

Tried checking if it is not null or by checking if they have a UUID

vestal dome
#

and what I did wrong etc?

gritty urchin
#

yet it is not nullable

drowsy helm
gritty urchin
#

and has a valid UUID

vestal dome
#

check if the OfflinePlayer is null

#

if not just get the player

#

shouldn't be hard

quaint mantle
#

ah i understood now sorry im bad at english buoobuoo

opal juniper
#

I would be certain that returns null

gritty urchin
#

No if I get the UUID of a non existant offline player

#

it still gives me

#

a UUID

#

(which doesnt exist)

#

but is still a UUID