#help-development

1 messages · Page 1940 of 1

rough drift
#

yep was about to say that

tender shard
#

whoa

#

210k downloads

#

that's yours?

rough drift
#

yep

tender shard
#

not bad

rough drift
#

and i still haven't released 2.0

tender shard
#

I am about to reach 100k downlodas with ChestSort in the next days

rough drift
#

nice!

tender shard
#

and got about 250k downloads in total

#

but

#

200k on one plugin, respect

rough drift
#

it feels really nice to hit triple digits

rough drift
tender shard
#

I have a ton of plugins but as said, all <100k 😄

rough drift
#

well you still got a 130k+ combined in them

#

so thats a win :D

glossy venture
#

nice

tender shard
#

how did you get so many downloads with, sorry, such a shitty plugin description + no icon? XD

delicate lynx
#

my most is only 732 :(

delicate lynx
#

lifesteal is popular

rough drift
#

Multiple vids on yt talk about my plugin as well

#

and how to install it

#

one of them has like 60k views

#
  • Its a really popular gamemode
rough drift
tender shard
#

I have now invaded your discord

rough drift
#

:O

tender shard
#

bruh

rough drift
#

what xD

tender shard
#

YOUR DISCORD ALSO DOESNT HAVE AN ICON

rough drift
#

I KNOW

tender shard
#

WHATS WRONG WITH YOU lol

rough drift
#

I AM NOT GOOD AT ICONS

tender shard
#

me neither

#

some swedish girl did all the icons for me

rough drift
#

the best i can do is hopefully put two pixels together in paint.net

tender shard
#

it's about 2$ per image

rough drift
#

thats cheap

tender shard
#

I use it all the time for new plugins

#

but yeah for discord you'll want to get a custom made one

rough drift
tender shard
#

I can draw a stickman for you and send it as png lmao

rough drift
#

the problem is idk what search terms to put xD

tender shard
#

I made sth for you lmao

#

1 sec

rough drift
#

o no

tender shard
#

Use this for discord or get rekd

rough drift
tender shard
#

it's not

#

it's just

#

😵‍💫

#

spirally

rough drift
#

yeah that's whats mostly associated with unconcious

tender shard
#

I always associate it with this song https://www.youtube.com/watch?v=2aeOBZ7gVPY

"TMBG wishes to make the case that not all of our songs have a single strict interpretation, but "Spiraling Shape" is generally about the fervent embrace and then abandonment of a cultural "bubble." It might be "smart" drugs, it might be virtual whatever, or it could simply be spin art. Steve Light adds his snazzy vibraphone to this swirling cut."

▶ Play video
rough drift
hushed garnet
#

How do I get PotionEffectType.valueOf ... it doesn't exist?

#

trying to turn a config string potion effect into a legit potion effect... not sure how

hushed garnet
#

Normally on an enum you get valueOf

tender shard
hushed garnet
#

huh I totally missed getByName! nice, thx

#

i looked at the docs too. lol 🤦

tender shard
#

it's a regular class with a bunch of static final fields

#

haha no problem

rough drift
#

You know what

#

I should actually rebrand my disc

#

Because me and one of my friends have a group name we don't use much

#

and we are planning on making a plugin together

#

so yeahhh

clever solar
#

I have a small question, is it possible to use apache poi on minecraft because I did some research, I found nothing ?

delicate lynx
#

it's just a library, so a plugin could use it technically

lost matrix
clever solar
#

The problem is that when I build my plugins it gives me an error that it can't access the library class.

lost matrix
#

Meaning copy it into your jar to create a so called uber jar.
Another way would be to use the plugin.yml to download the dependencies on runtime.

clever solar
#
implementation group: 'org.apache.poi', name: 'poi', version: '5.2.0'
clever solar
#

yes

tender shard
clever solar
buoyant viper
#

poi poi poi poi poi poi poi poi

tender shard
#

no idea how it works in gradle, in maven you just have to add the maven-shade-plugin and it magically works

buoyant viper
#

gradle shadow plugin

#

but cant they just use the new libraries in plugin.yml?

vocal cloud
#

Yeah maven is basically magic

unreal quartz
#

If it’s available on central yeah

shrewd sentinel
#

What is the initPathFinder function in Mojang mappings?

tender shard
shrewd sentinel
#

Not sure. Maybe

tender shard
buoyant viper
#

i feel like most if not all apache libs are lolz

tender shard
#

I'd love spigot to be able to use libs from non-mavne-central repos

tender shard
buoyant viper
#

repositories: [] when?

tender shard
#

yeah

#

lets ping md5

shrewd sentinel
dusty herald
#

my code doesnt work can you fix it for me

shrewd sentinel
#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

**__Trivia:__**

trivia Start trivia session on the specified category.

grim ice
#

anyone got an idea how to loop through json entries

#

example:

#

?paste

undone axleBOT
grim ice
tender shard
dusty herald
#

thank you sir

tender shard
#

np 🙂

shrewd sentinel
#

mfnalex where did you go with if I knew the obfuscated method name?

tender shard
#

e.g. just for example, imagine there's
Entity.x() and, in real names, Entity.getHealth(), you can just look in the mapping file and it will say x -> getHealth

shrewd sentinel
#

How do I see the mappings file?

tender shard
#

it's inside C:\Users<yourname>.m2\repository\org\spigotmc\minecraft-server\1.18.1-R0.1-SNAPSHOT

#

minecraft-server-1.18.1-R0.1-SNAPSHOT-maps-mojang.txt

grim ice
tender shard
#

looks like this

tender shard
clever solar
glossy venture
#

are there any vanilla 1.8.8 server downloads?

#

because i dont think there are any on minecraft.net anymore

spiral light
naive bolt
#

how do i check the world the command is issued in

buoyant viper
#

@glossy venture u should be able to do it through the launcher no?

glossy venture
#

nah the server jar

#

dedicated server

buoyant viper
#

yeah

glossy venture
#

is that possible>

#

?

buoyant viper
glossy venture
#

thats the client

buoyant viper
#

theres ab utton that says server

glossy venture
#

oh wtf thanks

#

didnt know that was a thing

clever solar
grim ice
golden turret
#

is the getItemInHand from the BlockPlaceEvent a clone of the actual item or the real item?

grim ice
#

i guess gson

#

cuz its included with spigot

delicate lynx
#
libraries:
   - org.apache.poi:poi:5.2.0

@clever solar try this?

grim ice
lost matrix
#

^

grim ice
#

yes but h o w

golden turret
lost matrix
delicate lynx
golden turret
brave sparrow
delicate lynx
golden turret
#

safe?

golden turret
clever solar
brave sparrow
grim ice
lost matrix
# grim ice yes but h o w

Something like

  public void loop(String jsonStr) {
    Gson gson = new GsonBuilder().disableHtmlEscaping().create();
    JsonArray jsonAry = gson.fromJson(jsonStr, JsonArray.class);
    for (JsonElement element : jsonAry) {
      JsonObject jsonElement = element.getAsJsonObject();
      String uid = jsonElement.get("uuid").getAsString();
    }
  }
brave sparrow
golden turret
#

yes

#

i will use the runTask

grim ice
brave sparrow
#

Yes

smoky oak
#
HashMap<String, String> map1 = new HashMap<>(200);
HashMap<String, String> map2 = new HashMap<>(200,0.75);

Can someone explain why specifying the load factor causes a error to appear at the <> of the second hashmap?

grim ice
ivory sleet
lost matrix
smoky oak
brave sparrow
#

Hover over the error and see what it says

ivory sleet
#

^

lost matrix
smoky oak
#

'Cannot infer arguments'

#

?

lost matrix
#

load factor has to be a float

smoky oak
#

not the point

lost matrix
#

Yes

delicate lynx
#

.7 isn't a float

waxen plinth
#

.7f

delicate lynx
#

there you go

smoky oak
#

y'all impossible

grim ice
smoky oak
#

wait

#

why tf

#

it tells me that error when it aint float

#

why doesnt it tell me that its supposed to be float

ivory sleet
#

Generics kek

lost matrix
grim ice
#

no method like that

lost matrix
#

Then you are using an old java version

grim ice
#

well yeh it is java 8

lost matrix
smoky oak
#

prob bc 1.12 was the last version that works well with one map and many players

quiet ice
#

Java 9 offers InputStream#readAllBytes and many more methods, such a lifesaver

#

Or was it J10? Probably J10 now that I think about it

grim ice
grim ice
#

im just not required to use jdk 16 since im doing 1.15.2

waxen plinth
#

You should use it

grim ice
#

I will

quiet ice
#

Well it allows you to do something like

String s;
try (FileInputStream fis = new FileInputStream(new File("file.txt"))) {
     s = new String(fis.readAllBytes(), StandardCharsets.UTF_8);
}
waxen plinth
#

But you can also do Files.lines(path).collect(Collectors.toString("\n"))

grim ice
#

u dont need an inputstream for that

#

u can do it with Files.readAllBytes()

quiet ice
#

That does the same thing

ivory sleet
#

^

grim ice
#

yeah

#

but longer

#

ty for the info tho

severe folio
#

is there a way to manipulate the growth rate of specific crops via events or whatever not the random tick speed

quiet ice
#

Why are people obsessed with code length?

grim ice
#

eh im not

young knoll
#

Long code = bad code

#

!00%

grim ice
#

i would use the longer version if it was any better

#

but its the same thing

wary harness
#

Any one can help with packet for spawning npc with second layer skin

ivory sleet
wary harness
ivory sleet
#

But a bit shorter if that’s what you’re after (:

grim ice
#

small performance boost wouldnt matter much compared to code being clean, am i wrong?

#

i might be

lost matrix
# grim ice yeah
  @AllArgsConstructor
  public static class PlayerData {
    private final UUID uuid;
    private double balance;
    private int blocks;
    private int pumpkins;
  }

  public List<PlayerData> loadData(File jsonFile) throws IOException {
    List<PlayerData> dataList = new ArrayList<>();
    String jsonStr = Files.readString(jsonFile.toPath());
    Gson gson = new GsonBuilder().disableHtmlEscaping().create();
    JsonArray jsonAry = gson.fromJson(jsonStr, JsonArray.class);
    for (JsonElement element : jsonAry) {
      JsonObject jsonElement = element.getAsJsonObject();
      String uid = jsonElement.get("uuid").getAsString();
      double bal = jsonElement.get("balance").getAsDouble();
      int blocks = jsonElement.get("blocks").getAsInt();
      int pumpkn = jsonElement.get("pumpkins").getAsInt();
      PlayerData data = new PlayerData(UUID.fromString(uid), bal, blocks, pumpkn);
      dataList.add(data);
    }
    return dataList;
  }

  public List<PlayerData> loadDataButCool(File jsonFile) throws IOException {
    String jsonStr = Files.readString(jsonFile.toPath());
    return new GsonBuilder().disableHtmlEscaping().create().fromJson(jsonStr, new TypeToken<List<PlayerData>>(){}.getType());
  }
grim ice
#

woah thank you

lost matrix
#

You should prefer the second method. Let Gson do all the serialization work

blazing scarab
#

ugh

blazing scarab
#

(custom gson adapter eoukd be better tbh)

ivory sleet
#

But generally speaking clean code is something you strive towards, however that does not imply succinct functions and less lines all the time 😅

lost matrix
#

All fields are serializable on default

#

No need for a custom adapter

waxen plinth
lost matrix
blazing scarab
quiet ice
#

Eh, If you want to do it custom do not bother with gson and do the conversion manually via org.json:json

lost matrix
blazing scarab
#

Gson also provides a fancy commonly used json api

grim ice
#

alr now i gotta learn how to set data to json file

#

i dont wanna annoy 7smile7 more so ill prob google this

lost matrix
tender shard
#

ugh why do I always get ghost pings in this channel lol

grim ice
#

tysm

#

sorry for annoying you

young knoll
#

Should you just hold the Gson object statically somewhere

#

Or like, in your main class

grim ice
#

wat

young knoll
#

What?

tardy delta
#

i like to do it in that way

waxen plinth
#

When you spoon-feed and it's still not enough

grim ice
#

nah

#

im tryna understand it

ivory sleet
grim ice
#

it might be spoon feeding but im not copy pasting it

lost matrix
#
List<PlayerData> dataList = ...;
File file = ...;
writeData(file, dataList);
grim ice
#

oh that makes sense

dusk flicker
#

wait does this still exist

#

?spoon

undone axleBOT
#

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

dusk flicker
#

pog

lost matrix
grim ice
#

that hopefully wont apply to me

#

if i feel like im annoying someone too much ill just google it

dusk flicker
#

GB I think you mean to be in #help-server, as this is for plugin development

carmine cove
#

Oh, my bad

grim ice
#

BTW, writing to files is expensive right?

spiral light
#

?google

undone axleBOT
grim ice
#

thx for the link ig

#

do I save data in a hashmap or something, then set it every 10 minutes or smth

#

or is that the same

#

as writing directly

weak kayak
#

you mean autosaving every 10 minutes instead of saving every time you change a value?

#

yes

#

that's generally faster

#

or more efficient

grim ice
#

is there a better wya

#

way

#

and btw is it possible to write to files (normal java files) and interacting with gson in async?

weak kayak
#

there might be, but autosaving every so minutes to me seems like a good enough solution

eternal night
#

Yes you can offload filesystem IO to threads other than the servers main thread

young knoll
#

You can write async

weak kayak
young knoll
#

Speed doesn’t really matter as much if you offload it

#

It won’t pause the server

smoky oak
#

how do i cast offlinePlayer to player?

weak kayak
#

(Player) offlinePlayer

smoky oak
#

um no

young knoll
#

They have to be online

#

Are they online

smoky oak
#

OFFLINE player

#

Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_18_R1.CraftOfflinePlayer cannot be cast to class org.bukkit.entity.Player (org.bukkit.craftbukkit.v1_18_R1.CraftOfflinePlayer and org.bukkit.entity.Player are in unnamed module of loader java.net.URLClassLoader @2e5d6d97)

dusk flicker
#

isnt there a method to do it

young knoll
#

You cannot cast an offline player to an online player

dusk flicker
#

like asPlayer or smth

young knoll
dusk flicker
#

.getPlayer

#

yea

weak kayak
#

you cannot cast NSM classes to bukkit classes

#

also

young knoll
#

But the player has to be online

weak kayak
#

you can cast offline players to players

dusk flicker
#

offline player isnt an NMS class

weak kayak
#

you just have to make sure they're online

tardy delta
#

Bukkit.getPlayer(offlinePlayer.getUniqueId())?

weak kayak
young knoll
#

That’s the impl

weak kayak
#

oh right

young knoll
#

OfflinePlayer is an interface

smoky oak
grim ice
#

is autosaving a file every 10minutes better than just writing directly (every 0,25 second) async?

#

prob yes

#

just making sure

tardy delta
#

i think there is not really another way

young knoll
#

There is

weak kayak
young knoll
#

Just getPlayer

#

But the player must be offline

grim ice
#

how about autosaving async

#

that must be the best way

young knoll
#

You cannot have a Player instance if that player isn’t online

weak kayak
young knoll
#

I would write async

#

No reason not to

weak kayak
#

you could cast an OfflinePlayer to Player

ivory sleet
#

No

weak kayak
#

but first you have to check if they are online
i.e. if(offlinePlayer.isOnline())

ivory sleet
#

Not if the instance of OfflinePlayer is not an instance or Player as well

ivory sleet
#

Yeah or just use sth like Server::getPlayer and null check that

smoky oak
#

im going with Fourteenth's idea

#

also

#

screw mojang's idea of naming stuff
PacketPlayInChat.a()

weak kayak
#

but not really

#

it's obfuscated

#

you can figure out what methods do and what classes are with enough effort

smoky oak
#

well its as easy as typing one string into cmd

#

but the fact that we have to do it in the first place

#

urgh

weak kayak
#

yeah

#

though it kinda makes sense

#

they don't want people to see their source code and steal it

tardy delta
#

offline player class

smoky oak
#

or that

#

the player instance is the same you'd get as if you grabbed a online player including PDC right?

tardy delta
#

pdc is permanent so i guess ye

shrewd sentinel
#

?paste

undone axleBOT
shrewd sentinel
young knoll
weak kayak
#

i too love naming my classes a and my methods a also

sullen marlin
#

sigh

sullen marlin
#

you understand World#setType literally just calls NMS, right?

dusk flicker
#

read the title

#

I think thats fast enough

sullen marlin
#
public static void setBlockInNativeWorld(World world, int x, int y, int z, int blockId, byte data, boolean applyPhysics) {
    net.minecraft.server.v1_14_R1.World nmsWorld = ((CraftWorld) world).getHandle();
    BlockPosition bp = new BlockPosition(x, y, z);
    IBlockData ibd = net.minecraft.server.v1_14_R1.Block.getByCombinedId(blockId + (data << 12));
    nmsWorld.setTypeAndData(bp, ibd, applyPhysics ? 3 : 2);
}```
shrewd sentinel
sullen marlin
#

legit, this is EXACTLY what spigot does

spiral light
#

isnt World#setType inefficient for more then just a few blocks since it always get the IBlockData or smth from the bukkit.-Material ?

sullen marlin
#

#2 isn't even different from #1

#
    net.minecraft.server.v1_14_R1.World nmsWorld = ((CraftWorld) world).getHandle();
    net.minecraft.server.v1_14_R1.Chunk nmsChunk = nmsWorld.getChunkAt(x >> 4, z >> 4);
    BlockPosition bp = new BlockPosition(x, y, z);
    IBlockData ibd = net.minecraft.server.v1_14_R1.Block.getByCombinedId(blockId + (data << 12));
    nmsChunk.setType(bp, ibd, applyPhysics);
}```
#

that thread is garbage

lost matrix
#

write directly into the region files and then re send the chunks ;:D

sullen marlin
#

the whole thread is literally just unwrapping the code

wary harness
#

any one can tell me how to spawn npc with second layer skin?

#

on 1.17 ?

tardy delta
#

i nearly summoned md_5 with talking about scoreboard with packets

wary harness
#

I am lost a bit found some example but there are outdated

sullen marlin
#

@weary geyser that method will fk your world

#

so where is the tile entity handling

#

or block cleanup

#

or physics

weak kayak
#

when the people are trying to optimize their code so hard they end up rewriting bukkit

#

nvm 💀

wary harness
#

for example here watch method is missing on 1.17

#

DataWatcher watcher = npc.getDataWatcher();
watcher.watch(10, (byte) 127);

sullen marlin
#

the data palette doesn't apply physics

spiral light
sullen marlin
#

if you can make a faster method that is actually correct, feel free to PR spigot to use it

#

but you wont, because there's no other correct method

#

and ligthing?

spiral light
#
IBlockData ibd = net.minecraft.server.v1_14_R1.Block.getByCombinedId(blockId + (data << 12));

i feel like stuff from Material to IBlockData is the problem in time

sullen marlin
#

you're leaving the world in an inconsistent and broken state

wary harness
dusk flicker
#

yet

spiral light
wary harness
#

DataWatcher watcher = npc.getDataWatcher();
watcher.watch(10, (byte) 127);
PacketPlayOutEntityMetadata packet4 = new PacketPlayOutEntityMetadata(npc.getId(), watcher, true);

#

now trying to do that in mojange mappings

spiral light
#

its outdated for 1.17

#

or not outdated ...

#

it has changed how the use DataWatcher

#

you will find in nms. Player/HumanEntity some DataWatcher registrys where exactly those "COSMETIC" stuff is applied

shrewd sentinel
#

?paste

undone axleBOT
wary harness
spiral light
quaint mantle
#

F

wary harness
#

😂

quaint mantle
#

Learning programming while making MC plugins is ❤️

young knoll
#

Ehhh

#

I dont recommend it

quaint mantle
#

Planning to do an JavaFX app that fires spigot events tomorrow

blazing scarab
weak kayak
young knoll
#

I still have missing hair

weak kayak
#

i learnt java while making spigot plugins and i was lacking in my java knowledge for about 5 months

young knoll
#

And that was 8 years ago

weak kayak
quaint mantle
#

practicing is the key to success

weak kayak
#

it's wonderful how i managed to not get bored of not knowing anything

blazing scarab
wet breach
#

its when you hit the point of knowing most things does boredom start to become an issue 😛

young knoll
#

And laziness

wet breach
#

but that is when you go from learning Java to learning the JVM 😉

young knoll
#

Like yeah I know how to write it, but I don’t want to D:

quaint mantle
#

I started with java a year ago and, just learning like 2h a week, 0 practice, and when i started on projects, i had no idea what to do. I started practicing like a month ago 2-3h daily, and got much better

hexed hatch
#

And lack of inspiration

young knoll
#

Make another scoreboard plugin

#

Duh

weak kayak
#

i've learned like 7 other programming languages from pure boredom

quaint mantle
#

+1

#

i learn csharp when i feel bored

young knoll
#

Microsoft java

weak kayak
#

9 if you consider esoteric languages, 10 if you consider the tiny amount of C# i know

young knoll
#

Java and C# are very similar

quaint mantle
#

maybe i'll do my game in unity who knows

weak kayak
#

boredom is awesome :D

quaint mantle
young knoll
#

But C# does have some nice extras

ivory sleet
#

Erdi you should learn Haskell 🙂

weak kayak
#

C# is the walmart version of java

young knoll
#

C# has LINQ

weak kayak
young knoll
#

I learned Turing

quaint mantle
#

c# has inner methods

ivory sleet
#

Category theory is just on another dimension

young knoll
#

Anyone ever use Turing

blazing scarab
#

oops reply

lost matrix
young knoll
#

It’s a langugae

weak kayak
ivory sleet
#

Ah yes

#

You’ll have to learn the true power of monads

quaint mantle
#

learn assembly better

ivory sleet
#

And monoids

young knoll
#

Mon what now

blazing scarab
#

functional programming 😳

young knoll
#

Monaco?

weak kayak
#

should we go to #general lol

ivory sleet
#

I mean you have probably already used a monad

lost matrix
weak kayak
#

prototype-based programming is pretty cool

weak kayak
weak kayak
#

you can like edit the prototype after you make the classes and shit

#

it's very cool

lost matrix
quaint mantle
quaint mantle
#

yay i hate js too

#

variable is variable

weak kayak
#

guys no offense

blazing scarab
#

Now write a java brainfuck compiler

weak kayak
#

i love javascript

young knoll
#

Brainscript

lost matrix
wary harness
#

@spiral light it works like charm

wary harness
quaint mantle
#

TS = better

weak kayak
#

very pog if i do say so myself

weak kayak
quaint mantle
#

waaay better

weak kayak
#

well yes

young knoll
#

strongly typed

#

Is good

weak kayak
#

static typing ftw

quaint mantle
#

strongly typed langs = waay better IMO

lost matrix
weak kayak
#

js doc comment things exist though
i.e.

/**
* @typedef {{name?: string, id?: number}} Options
*/

/** @type {Options} */
const options = {name: "", id: 0};```
wet breach
weak kayak
young knoll
#

Brainfuck is amazing

weak kayak
#

no cap

#

legit like 8 operators

young knoll
#

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
``` look at this amazing code
weak kayak
#

yes

lost matrix
young knoll
#

Lol

weak kayak
#

<>[]-+., language best language

young knoll
#

Which would you choose

weak kayak
#

i wrote a brainfuck interpreter in javascript once

#

well i copied it off of google but same diff

lost matrix
young knoll
#

Heh

young knoll
#

npm install

weak kayak
brave sparrow
#

Not just use an existing one

young knoll
weak kayak
#

but it would be fun if it did

young knoll
#

Thank god

#

Honestly I kinda like using node because it’s easy

#

Even if it’s you know

weak kayak
#

me when node js and browser js are almost entirely different languages

young knoll
#

Node

weak kayak
#

node is pog for making scripts without using python

#

cuz fuck python

#

i'd much rather write javascript than python

young knoll
#

They taught us PHP first, and using crap like xampp was annoying

#

And then node is just like “yes”

weak kayak
#

we should switch text channels

#

💀

buoyant viper
#

is it possible to de-crit an attack

wet breach
quaint mantle
#

xampp annoying?

young knoll
wet breach
buoyant viper
#

would that stop the particles

young knoll
#

No

#

Idk if they are client or server side

weak kayak
buoyant viper
#

might be both lol

weak kayak
#

it's pretty easy

young knoll
quaint mantle
#

js is badly designed

wet breach
weak kayak
#

pure javascript supremacy

buoyant viper
#

vanillajs >

weak kayak
#

vanilla js best js

#

can't convince me otherwise

#

i hate web frameworks

young knoll
#

I hate front end

quaint mantle
#

+1

weak kayak
#

front-end is easy
making it look good is the hard part

quaint mantle
#

making it look good is the easiest part

#

but

#

centering a div is the hardest part

#

:pepe:

weak kayak
#

💀

young knoll
#

Isn’t that part of making it look good

#

PDT?

buoyant viper
#

can github copilot center a div?

quaint mantle
#

fuck github copilot

young knoll
#

Pacific daylight time?

weak kayak
young knoll
#

You mean a pdc entry on the item

quaint mantle
#

if GPT codex doesn't fuck programmers then eat my words

young knoll
#

Yes

#

It just clears

#

It doesn’t care

undone axleBOT
minor otter
#

Anyone have a example of a block populator in 1.18?

vague swallow
#

Hi
I'm trying to cancel my InventoryClickEvent so if a Player clicks an item he can't take it. But for some reason it's not working with event.setCancelled(true);. Has anyone an idea if I can do something else or why it's not cancelling my event?

muted sand
#

is it registered :kekw:

vague swallow
#

yes

#

I checked it multiple times and I know exactly that the problem is in that line

drowsy helm
#

can you show all your code

vague swallow
#

ofc

#

gimme a sec

drowsy helm
#

yep

vague swallow
#
@EventHandler
    public void onHeadTake(InventoryClickEvent e) {
        if(e.getWhoClicked() instanceof Player) {
            e.getWhoClicked().sendMessage("hi");
            if(e.getCurrentItem().hasItemMeta()) {
                e.getWhoClicked().sendMessage("hi2");
                if(e.getCurrentItem().getItemMeta().getDisplayName().equals("§7Head")) {
                    e.getWhoClicked().sendMessage("hi3");
                    e.setCancelled(true);
                }
            }
        }
    }
#

it's sending all of the 3 hi messages

#

but it's not cancelling the event

drowsy helm
#

try and change the event priority

#

there could be another listener that is setting it to false

vague swallow
#

still not working

#

oh

#

I found out what was wrong

#

it was a bug

#

the items were ghost items

#

I just didn't realise that because I had a scheduler that was removing the items from my inventory and I thought they disappeared because of the scheduler

#

whatever

#

thank you!

#

I have another problem. Well my cursor bugs. If I set the cursor item to something it's only happening when I close the inventory and open it again, same with the removage of coursor items and I can take items when I'm cancelling the InventoryClickEvent, I just can't drop the items or put them somewhere. I'm using paper 1.18.1. Has anyone an idea?

drowsy helm
#

just update the inventory

#

and it should show

vague swallow
#

but I want it to change while I'm in the inventory. Without closing and opening it

young knoll
#

Are you using the non deprecated method

vague swallow
#

yes

#

What is the deprecated method?

foggy estuary
#

How do i remove invis armour stand ( hologram ) from my world lol.

#

Nevermind

#

fixed

young knoll
#

Is it real or packet basked

#

Based

foggy estuary
#

it was real

spiral cape
#

Hey guys!

vague swallow
#

Is there a way to make players transparent?

#

Another way than the team one?

spiral cape
#

I'm pretty new to MC plugin development and I'm trying to update a plugin that I made a year ago, I have an issue with runTask(), as for whatever reason the task doesn't run instantly and it lags the server down, I've done some console logs aswell to find the issue.

#
Bukkit.getLogger().info("started course....1");
            Bukkit.getScheduler().runTask(plugin, new Runnable() {
                @Override
                public void run() {
                    Bukkit.getLogger().info("started course....2");``` that's my code
#

and the second logger only gets executed after roughly 4 seconds

#

what has changed since 1.16.4 and 1.18.1?

abstract sleet
spiral cape
abstract sleet
#

show me where the runTask(plugin, new Runnable() { block finishes (not the end of the runnable, the end of runTask)

abstract sleet
#

you can decompile it to see how it works but its probably broken now, being so old.

dusk flicker
#

please use a code block

#

or better yet paste it

#

?paste

undone axleBOT
abstract sleet
#

currently dealing with this weird error. Maven thinks WorldName doesn't implement the parse method from ConditionHandler, but it does 🤷‍♂️. Note: these are in two different modules.

spiral cape
abstract sleet
spiral cape
#

so do i

#

and it shouldnt be delayed

abstract sleet
#

4 seconds did you say?

spiral cape
#

around

abstract sleet
#

between stage 1 and 3?

spiral cape
#

and i get server logs that server overloaded

abstract sleet
#

probably time to bin the plugin then 😦 if it's no longer updated

spiral cape
#

first stage log fine, second log around 4-5 seconds

#

3rd straight after 2nd

#

well, it's my own plugin that i consumed a ton of effort into a year ago ;p

#

and it doesn't seem to like 1.18.1

tall nova
#

https://hatebin.com/torqeesyqs This class is ran when a player dies, after it gets triggered the server starts lagging a lot and the corpse is not doing what its supposed to. In my code I'm setting it to have the same overlay the player had, I'm setting it to be in sleeping position and also to have its name tag hidden. Instead it just shows the same display name as the player and stands without the overlay

vague swallow
#

but ty

spiral cape
#

@vague swallow haven't tried and don't know, but what about the spectator mode?

abstract sleet
spiral cape
#

but surely the issue is somewhere in between those 2 loggers

#

but why???

vague swallow
spiral cape
#

give them invisibility potion ;p

vague swallow
#

still not transparent 😦 just invisible

tall nova
#

whats wrong with the teams way

spiral cape
#

transparent is technically invisible

#

or you mean the opacity of the players

abstract sleet
#

xamyr its probably worth making a post on the forums

vague swallow
vague swallow
vague swallow
#

How can I do that?

tall nova
#

Very hard to explain

#

But you have to send team packets

vague swallow
#

Ty!

vague swallow
#

Thanks

spiral cape
tall dragon
spiral cape
#

nope

tall dragon
#

so you're sure the server is fully started up when you attempt to run this task?

spiral cape
#

100%

tall dragon
#

thats very odd then

spiral cape
#
[00:39:43] [Craft Scheduler Thread - 1/INFO]: started course....
[00:39:43] [Craft Scheduler Thread - 1/INFO]: started course....1
[00:39:47] [Server thread/INFO]: started course....2
[00:39:47] [Server thread/INFO]: started course....3```
tall dragon
#

server might just be lagging?

spiral cape
#

well, the cause of that lag is when i trigger this runTask

tall dragon
#

well the first print gets print when the server already sais its lagging

#

so it must be something before

lost matrix
spiral cape
#

do you want me to show how it's triggered aswell?

tall dragon
#

yes please

lost matrix
#

This looks like it should be split into at least 4 methods

spiral cape
lost matrix
#

And this looks like it should be split into 5 classes and 20 methods...

#

wtf

tall dragon
#

was about to say that xD

spiral cape
#
case "[start]":
                    plugin.completedCourseTracker.remove(player);
                    plugin.playerCheckpoints.remove(player);
                    Bukkit.getScheduler().runTaskAsynchronously(plugin, new ParkourStartTask(sign, player, plugin, now));
                    break;```
#

ah yes i know ;p made this plugin a year ago

#

trying to refractor it completely

tall dragon
#

you might benefit from making it more readable first

spiral cape
#

but want to get it working at least just as it was a year ago

lost matrix
#

The PlayerMoveEvent is a really expensive event. You need to be REALLY careful when using it.

spiral cape
#

I know that, but, unfortunately the playerMoveEvent is not the cause of it

lost matrix
#
                    } catch (IndexOutOfBoundsException | NumberFormatException ignored) {
                    }

just hiding the exception ^^

spiral cape
#

shhhh, no one sees it ;p

lost matrix
#

Sry but this is unmaintainable. Not gonna read that

tall dragon
#

whats it even supposed to do

spiral cape
#

its a parkour plugin

tall dragon
#

yh i got that far

#

does it generate a parkour or something

trail remnant
#

how can i turn Particle.DustOptions dust = new Particle.DustOptions( Color.fromRGB(255, 16, 6), 1); into a particle variable

spiral cape
#

no, just tracks player that enters a course when they are above a sign that has [start]

tall dragon
#

alright, well as 7smile7 said, this is very difficult to read and figure out what could be going wrong i think ur truly best off remaking it on better standards

spiral cape
#

surely i probably gave all of the effort (roughly 30% haha) to the plugin a year ago cause of being lazy to make methods

tall dragon
#

yea, in my starter years I did this as well, the result being me not understanding my own code after 2 weeks of not looking at it.

spiral cape
#

yup, been there many times ;p

#

and a huge ass if statement ;p

#

that you have to scroll a mile to the right

tall dragon
#

well if you want to stop being there, make methods, classes if necessary, and also an important one is to comment alot

spiral cape
#

hmmm, guys? i just fixed the issue I think ;p

#

it was something to do with my database actually

patent horizon
buoyant viper
#

gradle moment

young knoll
#

Maven user

quaint mantle
unreal quartz
#

smh we have gradle haters in the house

quaint mantle
#

nobody beats rust error messages tho

#

imma make a programming language in rust

#

screw it

young knoll
#

Rusty

#

C + Rust

#

Crust

quaint mantle
#

its literally called crust

unreal quartz
#

crusty

quaint mantle
young knoll
#

Nice

unreal quartz
#

you're looking a bit crusty today

quaint mantle
#

why would you compile rust to C?

#

rust is literally better

unreal quartz
#

transpile rust to C++

young knoll
#

Portability?

#

Il2cpp

ebon arrow
#

Should I make my protection plugin chunk based or block/region based

tranquil viper
#
if(((Ageable) target).isAdult() && ((Ageable) stackee).isAdult()) {
                return false;
}

Shouldn't this return false if the target is an adult and the stackee is a baby or vice versa?

#

(yes I already checked if they were an instanceof Ageable)

worldly ingot
#

You can be fancy and use ^ instead of && there ;p

#

Probably less readable though

#

Actually, yeah, if you want vice-versa, ^ is the correct operator there

#

Performs a boolean XOR which evaluates to true if the two values are not equivalent (e.g. true/true = false, false/false = false, true/false = true, false/true = true)

tranquil viper
tranquil viper
#

Thanks

stuck flax
#

I have a question relating to writing custom plugins for a server, what would be the best way to structure the plugin(s)? All the code and features in one plugin, commands in one plugin and features in another plugin (etc)

young knoll
#

Separating them will make things a bit easier to maintain

tranquil viper
young knoll
#

But it’s up to you

stuck flax
#

Alright, thank you

tranquil viper
#

xD

#
if(target instanceof Ageable && stackee instanceof Ageable) {
        if(((Ageable) target).isAdult() && !((Ageable) stackee).isAdult()) {
            return false;
        }
}
#

This code should only return false if the target entity is an adult and the stackee is not an adult

#

although it seems to be returning false if they are both adults

#

Which doesn't make sense

worldly ingot
#

Ah, okay, misunderstood the original question then

#

That code looks like it would work fine. I guess just make sure you've stopped your server and exported the correct code

tranquil viper
#

Definitely have lol

#

guess it has to be some other part of my code messing it up

worldly ingot
#

Most likely. That snippet there looks fine

tranquil viper
#

Shoulve been

                    if(entity instanceof Ageable && nearby instanceof Ageable) {
                        if(!((Ageable) entity).isAdult() && ((Ageable) nearby).isAdult()) {
                            continue;
                        }

                        if(((Ageable) entity).isAdult() && !((Ageable) nearby).isAdult()) {
                            continue;
                        }
                    }
#

(I switched it to a for loop inside the event instead of my stack method)

worldly ingot
#

Yeah, you could merge those and use ^ like I mentioned above then,

if (entity.isAdult() ^ nearby.isAdult()) {
    continue;
}```
#

Should accomplish the same as both those if statements

tranquil viper
#

That didn't seem to work when I tried though

#

I will try again though why not

worldly ingot
tranquil viper
#

appreciate it 🙂

#

oh it did work...

#

guess I did something wrong the first time

worldly ingot
#

Also, if you're using Java 16,

if (entity instanceof Ageable entityAgeable && nearby instanceof Ageable nearbyAgeable) {
    if (entityAgeable.isAdult() ^ nearbyAgeable.isAdult()) {
        continue;
    }
}```
#

And you could && those statements together, but that's up to you

#

Lots of fun features

tranquil viper
#

I'm on 15

worldly ingot
#

PES_Think I don't remember if it was added in 16 or 15

tranquil viper
#

welp ^ seemed to work

#

thank you so much 🙂

worldly ingot
#

Maybe it was 14 haha So many versions

#

npnp

tranquil viper
#

fr

young knoll
#

15?

#

Wack

worldly ingot
#

15 is an odd choice, I agree. MC requires 16 for MC 1.17

#

Prior to that it was 8

sturdy ivy
#

Can I load classes into runtime with my class loader into runtime and use them in my bukkit plugin?

worldly ingot
#

Sure. You'd be better off creating a new class loader though and making it a child of your plugin's class loader

sturdy ivy
#

How can I make it a child of plugin class loader?

worldly ingot
worldly ingot
hardy swan
#

i think 16 added the pattern matching for switch or sth

#

or maybe that's 17

tranquil viper
#

Here is a video of my issue: https://gyazo.com/444c2165af251e5d4eeb9f70ca5bb0aa

My problem is that while normally the stacking of spawners works perfectly fine, whenever I place them on a passable block like in the video they bug out and instantly say that there is 2 of the spawner there, and cancel the event. Here is my event code:

Code (Text):

@EventHandler
public void onBlockPlace(BlockPlaceEvent event) throws IOException {
    BlockState against =  event.getBlockAgainst().getState();
    BlockState block = event.getBlock().getState();

    if (against instanceof CreatureSpawner && block instanceof CreatureSpawner) {
        CreatureSpawner blockSpawner = (CreatureSpawner) block;
        CreatureSpawner againstSpawner = (CreatureSpawner) against;
        if(againstSpawner.getSpawnedType() == blockSpawner.getSpawnedType()) {
            event.setCancelled(true);
            Inventory inv = event.getPlayer().getInventory();
            ItemStack mainHandItemStack = ((PlayerInventory) inv).getItemInMainHand();
            mainHandItemStack.setAmount(mainHandItemStack.getAmount() - 1);

            againstSpawner.setMaxSpawnDelay(againstSpawner.getMaxSpawnDelay() / 2);
            againstSpawner.setMinSpawnDelay(againstSpawner.getMinSpawnDelay() / 2);
            manager.add(against.getLocation(), event.getPlayer());
        }

    }
}
 
#

I think this stems from Spigot thinking the placed block is the same as the block against it

#

which isn't true

sharp flare
#

its because the event is cancelled

tranquil viper
#

No I figured it out

#

The cancelled part is intended

#

I just checked if the location of the block and the against were the same and it fixed all the problems

#

although I got a new question

#

is there an event to track a projectile moving, like an arrow for example?

sharp flare
#

Projectile events exist ig

tranquil viper
#

I am trying to add a particle trail to an arrow

sharp flare
#

launch event

bright jasper
#

Is it possible to use java records but downpile to be able to run on java 12

#

or something like that

worldly ingot
#

Ehm, probably not

#

Though if you want something similar to records but still want to compile against 8, you can use Lombok's @Data annotation I suppose

#

Generates a getter/setter for each field in your class

#

Generally not a fan of Lombok but I guess if you're just using one annotation it's probably fine lol

terse panther
#

Hello, Does anyone knows how can I resolve this problem working with NMS?
Btw the 'cannot find symbols' are about NMS pathfinder goals, so are NMS problem too
Version: NMS 1.18 Mojang remapped

#

On the imports all are okay, the problem is when I compile it

spiral light
#

i think they are named different

spiral light
#

your missing smth else

#

hmmm

#

?bootstrap

undone axleBOT
#

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

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

spiral light
#

^yeah there the example maven config

#

your probably not using the plugin of md5 to remapp the mappings

hardy swan
spiral light
#

looks like your maven cache has a problem somewhere i guess

hardy swan
#

refresh/restart your ide

terse panther
terse panther
hardy swan
#

The error is nothing about SpecialSource

spiral light
hardy swan
terse panther
terse panther
#

But when I compile, I get this

hardy swan
#

how do you compile

#

maybe trying running mvn clean install instead

terse panther
#

pressing that button (I do that when I compile in Gradle)

hardy swan
spiral light
#

yeah.... dont know rly but gradle is not maven ?

hardy swan
#

he is using maven currently

spiral light
#

so runnign gradle config will not work since it not uses pom ? or maybe something like that

terse panther
#

It's my first time compiling in maven btw

hardy swan
#

but yes

#

run in the same directory as the pom

terse panther
terse panther
#

Ok the console send a lot of code lines saying me this:

#

But I'm not secure about how can I change it

hardy swan
#

show full pom.xml

#

?paste

undone axleBOT
hardy swan
#

change compiler target and source to at least 1.8

main dew
#

Oh

hardy swan
main dew
#

org.apache.maven.plugins in do you set Java 7? 😅

spiral light
#

for 1.18.1 ^you can use java 16 or not ?

hardy swan
#

you can use java 8 for compiling 1.18.1 plugins too

main dew
terse panther
hardy swan
#

Just change the target and source to 17

terse panther
terse panther
terse panther
main dew
#

1.8-1.12.2 Java 8
1.13-1.16.5 Java 11
1.17-1.17.1 Java 16 (but 17 should work)
1.18+ Java 17

hardy swan
#

that is for running the server

#

compiling the plugin is backward compatible

main dew
#

No always 😅

hardy swan
main dew
#

Sometimes programmers don't like older versions (example worldGuard and worldEdit)

hardy swan
#

That's their problem, but they could always use older versions

#

but yea, java 17 is great

hardy swan
#

just that if you use compile it using java 17 then you probably cant use that plugin for 1.17 or earlier

main dew
#

I don't like Java 9+ (reflections ;/)

hardy swan
#

you ran the command in the wrong directory

main dew
#

I can't read this xD

#

I am on phone xD

buoyant viper
terse panther
#

Oh XD

#

Sorry

#

Same errors :(

hardy swan
#

oh wait

main dew
hardy swan
#

i think maven doesn't have 17 compiler kek

main dew
#

I joking

buoyant viper
#

i compile towards java 17 with maven

terse panther
#

But I can't understand this:
class file has wrong version 60.0, should be 55.0 Please remove or make sure it appears in the correct subdirectory of the classpath.
Is the pom asking me a older version of NMS?

chrome beacon
#

Use java 17

#

That's what it is telling you

#

16* ?

main dew
#

But Java 8 support load libs in runtime

chrome beacon
#

So does newer java

buoyant viper
#

if spigot can load a plugin surely u can load a library

terse panther
chrome beacon
#

Change your jdk

terse panther
#

ook

hardy swan
#

but it shouldn't? hm

blazing scarab
terse panther
#

Ok maybe it works, but I get now this error

#

But name is okay right?

main dew
main dew
#

But I think this should work hmm

chrome beacon
main dew
chrome beacon
terse panther
hardy swan
#

Nice

wooden fable
#

I've been sitting with a Nullpointer Exception for a while now and I can't seem to fix it.

I don't understand why it's there.
The header or the footer can both or one of them be null.
I'm using "whatToUpdate" for that

Code:

    private void update(StringBuilder header, StringBuilder footer, int whatToUpdate) {
        // 3 = both
        // 2 = header
        // 1 = footer
        // 0 = none

        if(whatToUpdate == 1) {
            TabAPI.getInstance().getHeaderFooterManager().setFooter(owner, footer.toString());
        } else if (whatToUpdate == 2) {
            TabAPI.getInstance().getHeaderFooterManager().setFooter(owner, header.toString());
        } else if(whatToUpdate == 3) {
            TabAPI.getInstance().getHeaderFooterManager().setHeaderAndFooter(owner, header.toString(), footer.toString());
        }
    }

I've also been debugging and I just see that "whatToUpdate" is then 1 so it should be correct.

lost hound
#

guys i need help

wooden fable
#

use ```

#

For a code block

lost hound
#

import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;

public class HelloWorld implements Listener {
    @EventHandler
    public void onBlockPlace(BlockPlaceEvent event) {
      Material type = event.getBlock().getType();
        if (type == Material.TORCH)  {
           Player player = event.getPlayer();
           player.sendMessage("Hello World");
           
         }
    }
}
#

this is my code

#

Player is highlighted in red

wooden fable
#

What's wrong?

lost hound
#

it says player is wrong

wooden fable
#

Import it

lost hound
#

cannot resolve symbol player

buoyant viper
#

import player

lost hound
wooden fable
#

You should learn java first but ok, with you're ide you can probably click on "Import Class" or something like that

sharp flare
#

Learn basic java pls

wooden fable
#
import org.bukkit.entity.Player;
lost hound
#

I know java

#

I'm new to spigot and plugin development

wooden fable
#

Well

sharp flare
#

Welp

wooden fable
#

Not enough then if you don't know how to import something

quasi flint
#

?learnjava

undone axleBOT
lost hound
#

I even need some devs to help me make my mc server

sharp flare
#

You don't have to ask that question if u know java

sharp flare
quasi flint
#

it can be done tho

#

for passion

lost hound
#

I'm making my own mc server

sharp flare
#

Great

quasi flint
#

how would it be paid

lost hound
#

monthly

#

Or weekly

vocal cloud
#

The forums has a great recruitment section

quasi flint
#

?services

undone axleBOT
vocal cloud
#

By using the inventory click event

#

event.getCurrentItem().getItemMeta().getDisplayName().equalsIgnoreCase(ColorUtil.color("&4aa" + player.getName())) I highly recommend using the PDC instead of name checking

#

Wait where is the inventory set?

#

Where is it set because why don't you just get the inventory clicked and clear that slot

#

Again, where do you set the inventory variable

#

Why not just event.getClickedInventory()

daring lark
#

how could i add custom armor model to custom item in my plugin?
I know that i can use customModelData but it's only changing item texture i want to change model texture.

tardy delta
#

Resourcepack

daring lark
#

how could i do this?

tardy delta
#

New Json file for the model

daring lark
blazing scarab
#

Even with optifine

#

Armor models are hardcoded

daring lark
#

thanks

vocal cloud
#

Why would you set it the inventory in the constructor? Is it a static inventory everyone can access?

#

So I assume the issue here is probably when you open an inventory it opens a copy of it not the inventory you're clearing the slot of. So you'd need to clear both the slot in the players opened inventory and the slot in the global inventory

vocal cloud
#

Then why is it not working

#

Maybe because they're not linked?

clever solar
#

I have a small question, can someone tell me how I can put apache poi as a dependency on my plugins.yml file. I have tried this way, but it doesn't work:

   - org.apache.poi:poi:5.2.0

Because without this library my plugins doesn't work and causes bugs, like :
java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/Workbook

tidal skiff
#

the particles arent directly on the crosshair

#

i remember there was a fix for this but i forgot what it was

wary harness
#

@clever solar you need to shade it to your plugin

#

Look how to compile lib and shade with maven

tidal skiff
wary harness
clever solar
wary harness
#

@clever solar probably u need to shade it in your plugin

#

Compile it with your jar of plugin if lib is not in central maven repository it wont work by adding it to plugin.yml

clever solar
wary harness
#

@clever solar i never use it with plugin.yml

#

Just compile it in your plugin jar and shade it like I said up

#

That should work

clever solar