#help-development

1 messages · Page 2110 of 1

ivory sleet
#

believe it lists the patterns

#

in general, you do wanna know the design patterns

#

as they are canonical forms of implementation designs with concrete names

#

very powerful tool, when two programmers both know the design patterns they can talk about the design of the code in a higher level

sterile token
#

Allright thanks

#

I will probably make the proejct open source

ivory sleet
#

sure

sterile token
#

So if people are interest they can help

ivory sleet
#

myeah

sterile token
#

what means myeah?

#

Oh o

spring pike
#

how to open an enchant inventory for a player?
player.openEnchanting() opens the gui, but there are no enchantment options and the console gives off an error

ivory sleet
#

what error? 😮

eternal night
#

iirc you need to connect it to a real enchantment table

spring pike
#

let me check one second

eternal night
#

as enchantment suggestions etc are calculated server side

spring pike
snow stratus
#

Running into a potential remapping issue if someone has any ideas:

[16:07:24 WARN]: [mcpe] Task #5555 for mcpe v2.1 generated an exception                                                 java.lang.NoSuchFieldError: OCEAN_MONUMENT                                                                                      at me.justindevb.mcpe.util.CSVParser.makeAreaSpawnGuardians(CSVParser.java:204) ~[mcpe-2.1-remapped.jar:?]              at me.justindevb.mcpe.util.CSVParser$2.run(CSVParser.java:146) ~[mcpe-2.1-remapped.jar:?]                               at org.bukkit.craftbukkit.v1_18_R2.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.18.2.jar:git-Purpur-1612]  

Line 206 is :

ResourceKey<ConfiguredStructureFeature<?, ?>> structureKey = BuiltinStructures.OCEAN_MONUMENT; 
#

pom.xml contains:

<plugin>
                <groupId>net.md-5</groupId>
                <artifactId>specialsource-maven-plugin</artifactId>
                <version>1.2.2</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>remap</goal>
                        </goals>
                        <id>remap-obf</id>
                        <configuration>
                            <srgIn>org.spigotmc:minecraft-server:1.18.1-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
                            <reverse>true</reverse>
                            <remappedDependencies>org.spigotmc:spigot:1.18.1-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
                            <remappedArtifactAttached>true</remappedArtifactAttached>
                            <remappedClassifierName>remapped-obf</remappedClassifierName>
                        </configuration>
                    </execution>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>remap</goal>
                        </goals>
                        <id>remap-spigot</id>
                        <configuration>
                            <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
                            <srgIn>org.spigotmc:minecraft-server:1.18.1-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
                            <remappedDependencies>org.spigotmc:spigot:1.18.1-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
sterile token
undone axleBOT
chrome beacon
#

1.18.1 remapping for 1.18.2?

snow stratus
#

that would do it...

rugged cargo
#

i know that earlier someone said you can't render the block outline effect for a player via a spigot plugin. but id like to know that works internally, im thinking it must use a packet or something for that. im gonna take a look at the protocol lib site for something along those lines. but if someone knows better please let me know. cheers. :)

chrome beacon
#

block outline?

#

You want the glowing effect?

sterile token
#

Block outline i think it only can be done on Client side

chrome beacon
#

Ah nvm

rugged cargo
#

i was afraid so.

#

6.1.10 Block Break Animation 6.1.11 Block Entity Data 6.1.12 Block Action 6.1.13 Block Change

#

these are not what im lookin for lol

sterile token
#

You want to do something like bandlion block outline?

#

Or what you want to do?

rugged cargo
#

whats the bandlion block outline?

sterile token
#

You want to have a custom outline with colors on the block?

rugged cargo
#

colors would be cool, but not required

sterile token
#

I dont kno what your goal...

chrome beacon
#

You can fake block outlines with glowing shulkers

tender shard
#

are you talking about this?

rugged cargo
#

im trying to make an inticator for the player of what blocks will be broken via a special tool

chrome beacon
rugged cargo
#

but wouldn't the shulkers interfere with the action of breaking the block?

tender shard
#

i'd just use particles. requires no packets, just a tiny bit of math and it can also look nice

rugged cargo
tender shard
#

then just use less particles? 😄

rugged cargo
#

yeah i guess. i recently toyed with the idea of using armor stands with an item on their head. but you can't break blocks behind it

#

ok, new question

#

can you make "custom particles" like you can make custom items?

#

mainly just retextured

chrome beacon
#

No

#

You can retexture existing ones but no make a new particle

rugged cargo
#

damn. ok

lethal knoll
#

@humble aspen what did you try so far?

half leaf
#
Caused by: java.lang.IllegalArgumentException: Name cannot be null
        at org.apache.commons.lang.Validate.notNull(Validate.java:192) ~[server.jar:git-Spigot-21fe707-741a1bd]
        at org.bukkit.craftbukkit.v1_8_R3.CraftServer.getWorld(CraftServer.java:1014) ~[server.jar:git-Spigot-21fe707-741a1bd]
        at me.cqveman.Primitivesx.commands.spawnCMD.onCommand(spawnCMD.java:33) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[server.jar:git-Spigot-21fe707-741a1bd]

so im new to spigot api, and i was making a /setspawn /spawn commands in 1.8.8, and i got this error

#

this is the line 33
final World world = plugin.getServer().getWorld(plugin.getConfig().getString("spawn.worldName"));

brave sparrow
#

You’re looking for a world that has a null name

#

So your plugin’s config doesn’t have anything for spawn.worldName

#

You have to make sure it isn’t null before you try to get the world

half leaf
#

how can i set it in config.yml

#

like how can i know the world's name

brave sparrow
#

You don’t have to set it by default

#

You just have to make sure it isn’t null before you try and find the world

half leaf
#

then why it says its null

half leaf
brave sparrow
#

Because if you don’t set it you can’t fetch the world

#

if (getString(…) == null)
return;

#

Or something to that effect

half leaf
#

okay i'll try it

lethal knoll
#

Also, your hashmap is inside your onPlayerBreakBlock

#

that will never work

#

That means you are constantly initializing a new map

#

over and over

#

initialize it on top of your class instead

half leaf
#

wait i think i've already done it

#
                   final double x = plugin.getConfig().getDouble("spawn.x");
                    final double y = plugin.getConfig().getDouble("spawn.y");
                    final double z = plugin.getConfig().getDouble("spawn.z");
                    final World world = plugin.getServer().getWorld(plugin.getConfig().getString("spawn.worldName"));
                    final Location location = new Location(world, x, y, z);
                    
                if (location != null) {
                    p.teleport(location);
                    p.sendMessage(ChatColor.translateAlternateColorCodes('&', backToSpawn));
                } else {
                    p.sendMessage(ChatColor.translateAlternateColorCodes('&', noSpawnSet));
                }
#

i did if location is null

#

and location got the world name and the x, y and z

#

.

half leaf
#

sry for the ping

brave sparrow
#

You can’t do getWorld without checking if the name is null

lethal knoll
#

private final HashMap<String, Integer> map = new HashMap<String, Integer>();

    @EventHandler
    public void onPlayerBreakBlock(BlockBreakEvent event) {
        Player p = event.getPlayer();
        Block material = event.getBlock();
        if(material.getType() == Material.DIAMOND_ORE) {
        map.put("DIAMOND", map.get("DIAMOND") ++);
        }
    }
    private void countOres(Block block, Material diamondOre, HashSet<Block> blocks) {
    }
}
brave sparrow
#

getConfig().getString returns null if the key isn’t in the config

#

So you’re effectively doing getWorld(null)

#

Which isn’t allowed

half leaf
#

but i sat it on my setspawncmd

#

i did this

brave sparrow
#

Apparently not

half leaf
#
plugin.getConfig().set("spawn.worldName", location.getWorld().getName());
brave sparrow
#

Also location will never be null

#

Since you just initialized it

brave sparrow
#

Well that apparently didn’t work

#

Is it in the config?

half leaf
#

uhm

#

that's was im gonna tell u

#

it neven showed in the config

#

for some reason

brave sparrow
#

I’m guessing that line isn’t being run

half leaf
#

btw i was in 1.18

#

and i waas just doing the location as an object

brave sparrow
#

What?

half leaf
#

wait

brave sparrow
#

if you do a = new Something() a can never be null after that point in Java

#

Unless it gets set to null later

half leaf
#

<mainClassName>.getConfig().getLocation(<path>)

#

i was doing this in higher versions

half leaf
brave sparrow
#

Location?

#

Not in those 3 lines

half leaf
#

didnt

#

i meant

brave sparrow
#

So you don’t need to check if location != null

#

It will never be null

#

The name of the world you’re trying to look up is null

half leaf
#

so like what should i do now

#

take the is not null if stat?

#

like its just dumb in 1.18 u could just do

Player p = (Player) sender;
Location loc = p.getLocation();
plugin.getConfig.set("spawn", location)
#

since location already have the x,y,z and the wrld's name

#

but in 1.8

#

no

half leaf
sterile token
#

@ivory sleet sorry for ping but i need recommendations for the ORM

#

What your issue?

quaint mantle
#

tells ya whats wrong

#

the key isnt set in the config

sterile token
#

Location implements ConfigurationSerializable, so you can directly do:

Player player = bla bla;
getConfig().set("spawn", player.getLocation());
player.teleport((Locaton) getConfig().get("spawn"));

half leaf
#

but i sat it

half leaf
#

but in 1.8 it doesn't work

#

i think

quaint mantle
#

one of the upsides of using updated software

sterile token
#

You are wrong, i tested on 1.8 its workings

delicate lynx
half leaf
half leaf
delicate lynx
#

how do you retrieve the values from the config

half leaf
#

i sat it in the setspawncmd

#
                    final double x = plugin.getConfig().getDouble("spawn.x");
                    final double y = plugin.getConfig().getDouble("spawn.y");
                    final double z = plugin.getConfig().getDouble("spawn.z");
                    final World world = plugin.getServer().getWorld(plugin.getConfig().getString("spawn.worldName"));
                    final Location location = new Location(world, x, y, z);
sterile token
#

Dont do that lmao

#

I already told whole code

half leaf
#

k i'll try it

sterile token
#

Its working because i use it on 1.8 and works with no errors

half leaf
#

okay

delicate lynx
#

yeah you should be able to just set the location itself, you shouldn't need to split it up like that

#

into your config

sterile token
half leaf
#

Bro i forgot to do plugin.saveConfig()

#

Wow

#

Just wow

ivory sleet
#

or go just by traits Ig

rugged cargo
#

is this valid java code?

Bukkit.getServer().getOnlinePlayers().forEach((Player p) -> {

        });```
lethal knoll
#

Looks like it?

#

why? :p

rugged cargo
#

i mean just will that work for looping players. collection functions aren't my strong suit

lethal knoll
#

Yea it will do

#

you need to use the p variable, to target the player

rugged cargo
#

ill keep that in mind definitely. thanks for that!

ivory sleet
ornate patio
#

is there an event for when a block is destroyed

#

not only by a player, but by natural causes

#

explosions, fire, or a /fill or /setblock command

lethal knoll
#

There are also dedicated events for example BlockExplodeEvent

ornate patio
#

for now I just know EntityChangeBlockEvent, BlockExplodeEvent, BlockBurnEvent

lethal knoll
#

Most of them are here

ornate patio
#

yeah but not all

#

for example the EntityChangeBlockEvent

#

also i noticed EntityChangeBlockEvent has "change block" in it, not removed

#

would this event be fired if the block is "changed" to air

nova prism
#

yh

feral socket
#

(@rugged cargo)

zinc mist
#

Is there a way to register a custom potion effect?
I am currently creating a new PotionEffectType, then using it to create a potion itemstack and give it to the player. The ones made using my new type don't have the color and don't have an effect listed and when used they don't display anything on the player

cedar hamlet
#
ShapedRecipe recipe = new ShapedRecipe(NamespacedKey.minecraft("blastPick"), item);
#

It's giving me this error

#
[21:43:26 ERROR]: Error occurred while enabling VanillaPlus v1.0-SNAPSHOT (Is it up to date?)
java.lang.IllegalArgumentException: Invalid key. Must be [a-z0-9/._-]: blastPicks
#

There are no special characters?

zinc mist
#

lowercase only

cedar hamlet
#

ah

zinc mist
#

XD

cedar hamlet
#

Yeah that fixed it

#

amazing

#

thanks

zinc mist
#

No problem, had that issue myself too many times XD

rugged cargo
#

why does Location#add() have to modify the location object.

#

lol

#

i wish it returned a new location

#

i can clone i guess

zinc mist
#

Does anyone know how to properly register a new potion effect type?
I tried to use reflections to change the byId to have a larger list, but it didn't work because the field is final static.

feral socket
#

even if you do, you won't be able to get it to display for the client

hexed hatch
#

There’s no conceivable advantage to registering your own potion effect

#

It will never show up to the client

shadow gazelle
#

What's the event that is fired when someone sends a message that lets you "delete" the message?

hexed hatch
#

But if you’re in need of one custom potion effect, I often repurpose bad luck

grand perch
#
public void onClick(InventoryClickEvent e) {
            e.getWhoClicked().sendMessage("a");
            if (e.getClickedInventory() == null) { return; }
            if (e.getClickedInventory().getHolder() instanceof mainShopGui) {
                e.setCancelled(true);
                Player player = (Player) e.getWhoClicked();

                if (e.getCurrentItem() == null) { return; }
                player.sendMessage("aA");

                if(e.getSlot() == 10) {
                    categoryGui category = new categoryGui("Blocks");
                    player.openInventory(category.getInventory());
                    player.sendMessage("aB");
                } else if(e.getSlot() == 11) {
                    categoryGui category = new categoryGui("Foods");
                    player.openInventory(category.getInventory());
                } else if(e.getSlot() == 12) {
                    categoryGui category = new categoryGui("Valuables");
                    player.openInventory(category.getInventory());
                } else if(e.getSlot() == 13) {
                    categoryGui category = new categoryGui("Pvp");
                    player.openInventory(category.getInventory());
                } else if(e.getSlot() == 14) {
                    categoryGui category = new categoryGui("Potion");
                    player.openInventory(category.getInventory());
                } else if(e.getSlot() == 15) {
                    categoryGui category = new categoryGui("Mob Drops");
                    player.openInventory(category.getInventory());
                } else if(e.getSlot() == 16) {
                    categoryGui category = new categoryGui("Spawners");
                    player.openInventory(category.getInventory());
                }
            }
    }

hi im having issues with inventoryclickevent

#

its not sending aB

#

but i can confirm its sending aA

feral socket
#

and which slot are you clicking

#

show us a screenshot

grand perch
#

ofc slot 10

grand perch
feral socket
#

you need to show which slot you are clicking on

grand perch
#

i litteraly said

#

slot 10

grand perch
#

2nd

grand perch
feral socket
#

so send a message of the slot that's being clicked

#

really very simple to debug things like this

grand perch
#

ok

ornate patio
#

is it possible to make a passive mob genuinely attack another mob

#

without faking it

#

as in not just moving the mob there and making the other mob take damage

#

Like can I use Mob#setTarget() on a horse

frosty echo
#

How would you make a TELEPORTING GUI?
Ive done the inventory, but then Im stuck after that

nova prism
hexed hatch
#

In api, no

#

With nms, absolutely

ornate patio
#

is there a tutorial for that somewhere

#

I’ve seen tutorials for pathfinding, not making passive mobs attack

hexed hatch
#

There probably are tutorials but I don’t know for which versions they support

#

But you’re going to want to replace the entity’s pathfinder goals

#

Haven’t done it myself since 1.15 and I don’t think I even have that project anymore

fringe wyvern
#

hi, kind of related how will i add nms to my plugin?

hexed hatch
#

buildtools, then in maven change spigot-api to spigot

fringe wyvern
#

yes I tried that but it still doesn't work

#

I do have buildtools installed btw

hexed hatch
#

What do you mean installed

#

Did you run buildtools?

fringe wyvern
#

yes

hexed hatch
#

Did you run it for the version of spigot you’re currently using?

#

And did you refresh Maven?

fringe wyvern
#

i tried that, maybe because of some other problems?

#

im gonna make another one and see if it will work

#

hmm it works now

#

no idea why

#

anyways im not complaining

tardy delta
#

Is a switch lookup faster than a map?

feral socket
#

the hardcoded one is probably better for performance, yes

hybrid spoke
tardy delta
#

Ok

granite owl
#

but i doubt its really relevant

#

but i switch my commands

tardy delta
#

It became more flexible in recent versions 😋

granite owl
#

casting them to lowercase and then switch em

#

because its certainly faster than ifs

#

and ppl can say what they want about bad practice they can enjoy their yandere dev styles if else ifs

#

🤣

granite owl
#

tho being able to switch strings is reserved for recent versions of java and language exclusive cause its casting strings to hash values

#

u wont get far with it in C xD

vocal tundra
#

Yandere dev is a godly coder how dare you!

granite owl
#

if studenID == 1 else if studenID == 2 else if student id == 3 ...

#

add another 300ish ids

vocal tundra
#

Everyone knows
if x == 1 print("1") else if x == 2 print("2")

#

Is the most clear way to write code

granite owl
#

he said the development process keeps taking longer cause java is a bad language taking ages to compile

#

cant argue with that

#

but its most certainly not due to his 10k's of lines of redundant calls each frame

vocal tundra
#

Is it still not done

granite owl
#

not even the 2nd rival

vocal tundra
#

I thought he was gonna hand it off to a team to do it

granite owl
#

its the star citizen of weaboos

vocal tundra
#

After the 100 year beta I guess

short raptor
#

How can I change the name of the player above their head?

granite owl
short raptor
#

Only in chat

vocal tundra
#

Did you set it to visible too

granite owl
#

btw before i waste time on it, i can set custom skins by sending packages to clients right

#

but can i also specify cape data?

short raptor
granite owl
#

to say add guild capes

vocal tundra
#

CustomNameVisivble

short raptor
vocal tundra
tardy delta
granite owl
vocal tundra
#

So try having an account with the cape for the gameprofile and then set it's skin

#

That could just be optifine tho

granite owl
#

tbh i wanna set the ability to craft banners and then register its pattern as guild cape

#

by serializing the info of the banners pattern

#

xX

vocal tundra
#

Ye you can't just set a custom made cape like that

#

You can't send cape textures to the client

granite owl
#

thats oof

vocal tundra
#

You could tp a banner behind them tho

granite owl
#

thats

#

not a solution

vocal tundra
#

You could make it good

#

If you put effort into it

granite owl
#

nah im still going to try it

grand perch
#
e.setCancelled(true);
                Player player = (Player) e.getWhoClicked();
                if (e.getCurrentItem() == null) { return; }
                player.sendMessage(String.valueOf(e.getSlot()));

                if(e.getSlot() == 10) {
                    categoryGui category = new categoryGui("Blocks");
                    player.openInventory(category.getInventory());
                    player.sendMessage("aB");
                } else if(e.getSlot() == 11) {
                    categoryGui category = new categoryGui("Foods");
                    player.openInventory(category.getInventory());
                } else if(e.getSlot() == 12) {
                    categoryGui category = new categoryGui("Valuables");
                    player.openInventory(category.getInventory());
                } else if(e.getSlot() == 13) {
                    categoryGui category = new categoryGui("Pvp");
                    player.openInventory(category.getInventory());
                } else if(e.getSlot() == 14) {
                    categoryGui category = new categoryGui("Potion");
                    player.openInventory(category.getInventory());
                } else if(e.getSlot() == 15) {
                    categoryGui category = new categoryGui("Mob Drops");
                    player.openInventory(category.getInventory());
                } else if(e.getSlot() == 16) {
                    categoryGui category = new categoryGui("Spawners");
                    player.openInventory(category.getInventory());
                }

its not sending aB even tho its sending 10

#

i clicked on 10th slot

granite owl
#

the info of capes must go trough the server before being sent to players

grand perch
#

dm me the answer i gtg

granite owl
#

ill try to manipulate it anyway xD

vocal tundra
#

No cape textures are sent

#

If anything it's just a value from like 0 - 10

tardy delta
#

Use a switch lol

eternal oxide
#

I told you yesterday you can't open am Inventory while IN the InventoryClickEvent

#

delay it

#

?scheduling

undone axleBOT
grand perch
#

wait

#

but its sending 10??

eternal oxide
#

?paste your whole class so we can see what you are really doing

undone axleBOT
granite owl
#

so capes are just numbers which then being requested by the client from the mojang server directly?

grand perch
#

imma go byeeee

vocal tundra
#

I'm saying if it sends cape data at all, it's gonna send something similar like an enum or string with the name

#

But it doesn't send cape textures

#

Mojang didn't even want people making custom capes at all, it used to be against EULA, not sure if it still is

#

And optifine capes use their own special server unrelated to yours

#

If you used an actual banner item on an armor stand you could get a really good result tho just saying

#

To any spectators it would look amazing

vocal tundra
#

And you'd have to change their gameprofile I'm pretty sure

granite owl
#

thats async for the player himself tho as walking is async

#

no those sloppy solutions aint for me

#

same as ppl told me to cancel the op command

#

ive ended up accessing the command map and overriden the command directly in the nms command map

#

accessed via reflection

#

cause i wanted to alterate the op and deop command

vocal tundra
#

Walking ain't really async I think you mean it's gonna appear disjointed on the client

granite owl
#

walking is async

#

otherwise ud jitter client sided

vocal tundra
#

It's handled on the main thread, like all other physics calculations

granite owl
#

i mean async to the server

#

the server only resets ur position if the gap is too big for given time

vocal tundra
#

Uhh

#

That's handled on the main thread of the server too

sage dragon
#

The only way I can show custom blocks would be via ArmorStands, right?

#

Unused in terms of a player can't get them in survival mode?

#

Good idea, thank you 👍

#

Let's see how much pain I'll suffer 😅

vocal tundra
#

Too much pain

grand perch
#

what

#

theres nothing in there

#

execept a inventory thing

golden turret
#

you could refactor the whole code

grand perch
golden turret
#

i said that you could refactor the whole code

grand perch
#

why

golden turret
#

because you could refactor the whole code

grim ice
golden kelp
#

hey guys, i am making a plugin which gives the player rewards when they do a command. I want to check if they have permission X. How can I?

#

(The server is using LP for ranks dont know if it is useful but....)

golden turret
#

player.hasPermission?

restive tangle
#

I'm going to make an API for a plugin, it would be good for all the API functionalities to be in a separate package right?

river oracle
#

Idk

#

Depends how you wanna structure it

restive tangle
#
group.id
  api
     APIInterface
     APIImplementation
  otherpackages
    
  MainClass
gleaming grove
restive tangle
#

How would I implement it then?

#

So how would it work? Do I make a seperate project which just has some data classes and an interface and then implement it using my plugin?

gleaming grove
#

Like it depends what would be goal of your API, It will be just set of helping functions and classes?

#

Or It will be the Core of the logic for your plugin?

eternal night
#

you don't really need a seperate project unless you plan on making the API open source but the impl closed source

restive tangle
#

It's a kit pvp plugin, I want it it to return the kit and stats of the player

gleaming grove
#

I would do it like this

#

In API package store all interfaces

#

and Implement them in classes that are inside ultra_pvp package

restive tangle
#

Oh, alright

#

Thanks

chrome beacon
#

?main Don't forget 🙂

restive tangle
#
java
  group.id
    api:
      IAPI
    plugin:
       packages:
       APIImpl
       MainClass
golden kelp
#

How to get the permission name from LP

golden turret
#

well

#

what do you want to do

golden kelp
#

i want to check if they have the rank VIP

#

rank is connected to permissions ig?

gleaming grove
#

bool hasIt = player.hasPermission("player.vip");

#

replace player.vip with the name of your vip permission

golden kelp
#

How do i find the name, thats the main thing xD

#

(Context: I used LP to setup the ranks)

golden turret
#

i think that ranks are linked to lp

restive tangle
#

I have an organization, like GitHub accounts can I use this as a group id?

golden kelp
#

lp doesnt use perms for it then?

golden kelp
#

I use smth like

io.github.orgname
golden turret
#

you can name anything with the name you wants to

#

if someone or some comany will complain about it

#

it is just a bonus :D

restive tangle
#

for packages and names which should have spaces, do we just use lowercase and ignore or add _?

hybrid spoke
#

_

#

or split them

golden turret
#

i never used _

hybrid spoke
#

my.fuck.ing.package

golden turret
hybrid spoke
#

but my.fuck_ing.package

restive tangle
#

So

io.github.the_organization
hybrid spoke
#

nah

#

for what the article

restive tangle
#

Group ID

golden turret
#

i personally dont like _ in packages

#

i prefer to rename it with a single name

#

but now i heard about split the packages

#

i think i will use that

restive tangle
#

So you shouldn't use _ in a group ID?

hybrid spoke
#

you can

#

its up to you

golden turret
#

you can name it anything java allows

#

so

#

com.hello_this_is_my.packagE.coolSuBpAcKaGe

hybrid spoke
#

1, 3, 4, 5 are redundant

#

but 2 is a valid point

golden kelp
#

How to get the permission name from a LP Rank

golden turret
#

you said you want the rank nmae

#

check lp docs

grand perch
golden turret
#

see the wiki

golden kelp
#

Aight tanks

golden turret
#

?scheduler

#

?scheduling

undone axleBOT
hybrid spoke
golden kelp
golden turret
#

i hope i helped 👍

golden turret
golden kelp
#

frick

#

So I gotta use LP API?

golden turret
#

maybe

#

idk if vault have something for groups

#

but if it does

#

use vault api instead of lp one

golden kelp
#

why?

golden turret
#

because that will work with any plugins that uses vault

golden kelp
#

oh ok

hybrid spoke
#

you need to get the nodes for the group

golden kelp
#

Aight

hybrid spoke
golden kelp
#

I have used the LP Api in the past

#

just wanted to know if there was a shorter way to do it which supported way more plugins

eternal oxide
#

just use Vault

eternal oxide
golden kelp
#

Yea then i can check in it?

eternal oxide
#

check for what?

golden kelp
#

check for the rank perm

#

yea thats the sad part, thats why i used the other method

tardy delta
#

they use permissions for groups iirc

golden kelp
#

for me

eternal oxide
#

I've no idea what you mean by a "rank perm" so I'll assume you are talking about nodes with values, like a prefix

tardy delta
golden kelp
#

Alright

tardy delta
#

check the docs lol

lean gull
#

does anyone know what the event is for when a grass block dies? like when you put a block ontop of it and then after a short amount of time it will turn into dirt

hybrid spoke
golden turret
#

i think block physics does but idk

#

its docs says it is not very good

tardy delta
#

two people responding to the same question

eternal night
#

and both wrong xD

#

lol

#

BlockFadeEvent is the one you are after

grand perch
#

how do i get the plugin for runtasklater?

eternal night
#

the instance of your main class is your plugin intace

grand perch
#

alr

eternal night
#

pass it to the objects that need it using dependency injection

hybrid spoke
grand perch
#

whats an L

#

20L

hybrid spoke
dire marsh
#

long

#

you took 20 L's

hybrid spoke
#

haha L

noble lantern
#

L L L L L L L L L L * 2

grand perch
#

whats the optimal L for it?

eternal night
#

eh

#

not really optional

#

that defines how much delay you have before your task executes

#

20 would be one second

#

1 is a tick (50ms)

grand perch
#

so L is a tick

eternal night
#

no

#

L is a long literal

#

you don't need an L there

golden turret
#

LLLLLLLLLLLLLLLLLLLL

dire marsh
#

unless you like taking L's

golden turret
#

20L

#

llllllllllllllllllll

#

20l

hybrid spoke
#

funny how just 1 people help

#

and the others just spamming L's

noble lantern
#

Was just typing that lmao

hybrid spoke
#

LLLLLLLLLL

dire marsh
#

this channel is for memes, not help

#

imagine thinking you actually get help here

hybrid spoke
grand perch
#

i think im gonna do 20L

noble lantern
#

It really depends on how much delay you need

grand perch
#

i need as least delay as possible

#

but still needs it

noble lantern
#

1L or even using runTask is enough for some thing (runTask is a 1 tick delay)

grand perch
#

ok

noble lantern
#

Do not set inventory slots a tick later btw

golden turret
#

remember

noble lantern
#

Dupe bugs happen with that

golden turret
#

1 tick = 50ms

grand perch
#

how long is an L

eternal night
#

😢

golden turret
#

the L is the long literal

noble lantern
#

Lynx told you lol

golden turret
#

so

#

1 is an integer

#

1L is a long

eternal oxide
#

20L = 1 tick

grand perch
#

1Liter?

golden turret
#

1L means 1L

grand perch
hybrid spoke
grand perch
golden turret
grand perch
#

looks good

hybrid spoke
noble lantern
#

I was right idk why I removed my msg so many people saying things made my brain overload lmao

dire marsh
#

don't overthink it

hybrid spoke
#

wait, i get confused

eternal oxide
#

yeah 1ms

#

I was wrong

dire marsh
#

it really doesn't matter if you type 20 or 20L

eternal oxide
#

not awake

golden turret
noble lantern
#

1L = 50ms = 1 tick

golden turret
#

if it is an int and you try to pass 1L

#

it will not work

#

also

tardy delta
#

TimeUnit when

golden turret
#

the L makes it a long so you will have a biger limit

#

64bit i guess

noble lantern
#

I love how everyone in here got tripped up about a number lmfao

golden turret
#

and 32 for int

dire marsh
#

remember scheduleAsyncTask being deprecated for confusing naming lol

hybrid spoke
tardy delta
#

difference between runtasklater(1) and runtasklater(1L)?

#

🤔

eternal oxide
#

nothing

golden turret
#

one is int

#

the other is long

grand perch
#

hm

noble lantern
grand perch
#

still doesnt work

golden turret
#

but as you are using a small number

noble lantern
#

Everyone confused each other lmao

golden turret
#

nithibg

golden turret
tardy delta
#

lets do not use more bits than we want uwu

noble lantern
hybrid spoke
noble lantern
#

And code ^

grand perch
#
                if(e.getSlot() == 10) {
                    player.sendMessage("aB");
                    BukkitScheduler scheduler = Bukkit.getScheduler();
                    Plugin plugin = new FixmcShopGui();
                    scheduler.runTask(plugin, () -> {
                        categoryGui category = new categoryGui("Blocks");
                        player.openInventory(category.getInventory());
                    });
                }
golden turret
grand perch
tardy delta
#

the pointer to the long or int still has the same size

#

what are we doing lol

dire marsh
#

this chat is so stupid

noble lantern
golden turret
eternal oxide
#

You can;t do Plugin plugin = new FixmcShopGui(); There is only ONE instance of your plugin and Spigot creates it

grand perch
#
[12:57:35 ERROR]: Could not pass event InventoryClickEvent to FixmcShopGui v0.1
java.lang.IllegalArgumentException: Plugin already initialized!

theres this error

hybrid spoke
noble lantern
#

What elgar said ^

tardy delta
#

wait do primitives even work with pointers?

#

references are just fancy pointers

grand perch
tardy delta
#

or smth

noble lantern
#

Im on phone i cant see code to well

tardy delta
#

😂

#

i did too much rust

golden turret
#

bruh

noble lantern
golden turret
#

?learn-java

#

?learnjava

undone axleBOT
noble lantern
#

Wait

#

This is JAVA?

golden turret
#

Wait

noble lantern
#

Shit.... I thought this was c++

eternal oxide
golden turret
#

This is SPIGOT?

tardy delta
#

this is javascript here

crude estuary
#

What

tardy delta
#

scripting java with the bitches

crude estuary
#

how can it be C++

golden turret
noble lantern
#

Idk that code looks like c++ to me, thought this was the c++ minecraft developers discord for noobs

golden turret
#

omg

tardy delta
#

c++ where

golden turret
#

IT HAD A Bukkit.getScheduler()

#

how can bukkit have a c++ version

noble lantern
#

Back to dealing with fucking reflections yay

grand perch
#

getPlugin isnt a thing

noble lantern
#

Just started earlier this morning

grand perch
#

im doing this with a javascript mindset this is hard

tardy delta
#

im wondering what the heck happened here

crude estuary
#

then how are you Going Back with Reflections

golden turret
#

🤔

noble lantern
#

Okay im done trolling

noble lantern
#

Sorry

tardy delta
#

isnt this dotnet here?

noble lantern
crude estuary
noble lantern
#

That

hybrid spoke
#

be serious

noble lantern
hybrid spoke
#

Serious Spigot and BungeeCord programming/development help | Ask other questions here

tardy delta
#

who wrote that

crude estuary
#

Md5?

noble lantern
#

Me

tardy delta
#

that second sentence doesnt make much sense then

golden turret
#

JavaPlugin.getPlugin(MainClass.class)

#

or

tardy delta
#

please not

golden turret
#

MainClass.getPlugin(MainClass.java)

tardy delta
#

singletons look ugly

noble lantern
#

Dependency injection is so much b-

#

WHY

#

NAW

hybrid spoke
#

DI is great

noble lantern
#

That method makes me angry it looks so damn goofy

noble lantern
#

I quit java

crude estuary
#

Right?

golden turret
#

singleton is good only when using dependencies from other plugins

#

so

crude estuary
#

who Names his Main Class

#

MainClass

golden turret
#

OtherPlugin.getPlugin bla

noble lantern
#

I provide dependency injection with reflection dogekek

hybrid spoke
eternal night
#

if only bukkit had like, a service provider

eternal night
#

:kappa:

golden turret
#

yes

#

but who asked 🥶 😎 🥵

#

also

crude estuary
#

Hey

#

Serious Development

golden turret
#

i dont like the idea of passing each class to the service provider

tardy delta
#

if i see md5 ask him to add kek emote

golden turret
#

dont loading

hybrid spoke
golden turret
#

net issues

crude estuary
#

kek dog

noble lantern
#

Got that dial up internet

tardy delta
noble lantern
noble lantern
#

Me sleeping at night with my nitro

hybrid spoke
golden turret
#

stop ending emojis

noble lantern
golden turret
#

dont waste my 4g

crude estuary
#

this is Serious Chat

hybrid spoke
noble lantern
#

Plus mine handles auto registration of anything from player data, commands, events etc

golden turret
#

😭 😫 😩 😔 😐 👍 💯

noble lantern
#

I never initialize anything manually anymore, just annotate class and boom

crude estuary
#

Fast Dev

noble lantern
#

Thats what I wanted ngl

golden turret
#

i dont to waste 5ms of the runtime

noble lantern
#

I got tired of dealing with bloat code so I spent 30 hours making this

noble lantern
quaint mantle
#

Hello, How would I access a variable on the main class from another class?

eternal oxide
#

?di

undone axleBOT
golden turret
noble lantern
#

Had irony?

golden turret
#

enlgish time

tardy delta
noble lantern
#

Shit

#

On

tardy delta
#

disk full

golden turret
#

download more disk

crude estuary
#

is there a Page like downloadmoreram for the Disk?

noble lantern
#

?downloadram

grand perch
#
java.lang.IllegalArgumentException: Plugin already initialized!
    at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:229) ~[patched_1.17.1.jar:git-Paper-408]
tardy delta
#

lol

golden turret
grand perch
noble lantern
crude estuary
golden turret
#

try localhost then

crude estuary
#

dnsn't

#

it is non existent

golden turret
#

fuck

tardy delta
grand perch
#
    FixmcShopGui fixmcShopGui = new FixmcShopGui();
    FileConfiguration config = fixmcShopGui.getConfig();

yes its this one

golden turret
tardy delta
#

dont make a new plugin instance

golden turret
noble lantern
hybrid spoke
golden turret
#

use

#

?di

undone axleBOT
noble lantern
#

?di

undone axleBOT
noble lantern
#

Oh

#

Lol

tardy delta
#

lmao

crude estuary
#

Imagine DDOSing localhost

hybrid spoke
#

no

#

hell

#

oh

noble lantern
tardy delta
#

lets remove some school shit and games from my disk

hybrid spoke
#

internet

#

my

#

is bad

noble lantern
golden turret
crude estuary
#

o seu IP

noble lantern
#

I hate when I get in bed then have a million ideas for something I could of done better

tardy delta
#

same 👉👈

hybrid spoke
#

sleep is for the weak

noble lantern
#

Your right

grand perch
#

oh dependacy injection is basicly constructor arguments in javascript

noble lantern
#

I could stay up and whack out another 4 hours

golden turret
#

today i went sleep 01 am i guess

#

and wake up 5:25

hybrid spoke
#

at least you have the thirst for action

#

mine is gone

golden turret
#

some days i sleep 02:30

noble lantern
#

Its 6:16am for me rn

golden turret
#

a time ago i sleep 05:00 to wake up 06:00

tardy delta
#

i just drank a whole bottle of juice and im still thirsty 😑

noble lantern
#

Spent 2 hours before bed writing more bullshit javadocs

crude estuary
#

Guess the Majority of us Share the Bad Sleeping

golden turret
#

maybe yes

#

maybe not

#

perhaps

#

probably

hybrid spoke
#

you cant go to sleep if you dont have a bed

golden turret
#

the possibility is existent

hybrid spoke
#

you can just fall asleep

crude estuary
#

or You can Sleep on the Computer Chair

noble lantern
#

Last time I did that I broke my monitor

crude estuary
#

so You wake up and Code Again

hybrid spoke
noble lantern
#

I turned my pc off anyways

golden turret
#

go sleep!

noble lantern
#

Poor things been running 3 dev test servers for days now

golden turret
#

i think i have the solution for your problem

#

simply

#

download more time

noble lantern
#

I could just drop 1.8-1.13 support for everything I do too

#

Works a lot better

crude estuary
#

There is

noble lantern
#

Would save soooo much time

golden turret
#

me too

crude estuary
#

a Page for Disk

noble lantern
#

I only made my api compatible with versions compatible with java16

#

No more catering to 1.8 nerds

golden turret
#

i almost wasted my internet

noble lantern
crude estuary
golden turret
crude estuary
#

and Half of the Servers

noble lantern
#

Wellp my javadocs and wiki is in English

#

Suks for them

golden turret
#

they know how to bore people to translate it for them

crude estuary
#

But you can Run Java 17 with a Modified 1.8.9

golden turret
#

yes

noble lantern
#

Dont give them ideas

golden turret
#

just recompile 1.8.9

crude estuary
#

Just Remake 1.8.9

noble lantern
grand perch
#

OMG

#

OMG

noble lantern
#

Nothing before the PDT update

grand perch
#

IT WORKED

#

THX GUYS

crude estuary
#

What Worked

eternal night
#

If you recompile 1.8.9 make sure to revert the log4shell changes so you can have the trust legacy experience

noble lantern
#

I wish my code would work

golden turret
#

use the argument -DiAmUsingJava17PlsBelieveMe

crude estuary
golden turret
#

also

#

did you know that spigot have an argument to ignkre the version checker

crude estuary
#

of Java?

#

Yes

golden turret
#

yes

eternal night
#

spigot has that ? I thought that was a paper thing

noble lantern
golden turret
#

-DISwearIknowWhatIAmDoing i guess

#

it is in the code

eternal night
#

that is to disable update checks for spigot

crude estuary
#

But it's so Unstable to use Java 17 with 1.8 or Another Legacy Version

eternal night
#

not the java check

golden turret
#

yes

eternal night
#

oh

#

that is what you talked about xD

grand perch
#

also its sending a message of a command im doing

eternal night
#

LOL

golden turret
#

reflection changed a lot

crude estuary
#

Yes, it Literally Breaks almost Everything

grand perch
#

like when i do /command it sends /command to me

noble lantern
#

1.14=<

crude estuary
#

1.14, i Remember that Update, not for Something Good

noble lantern
#

Wait 1.13 had the pdt update didn't it

#

If so 1.13=<

sterile token
#

Any api for detecting player movement (left, right, top and bottom) ?

golden turret
grand perch
sterile token
grand perch
#

guessed it

noble lantern
golden turret
#

and check to and from

glossy venture
#
Field field = yourMom.getClass().getField("fat");
field.set(yourMom, false);
``` `IllegalStateException`
golden turret
#

they can go to left facing north

sterile token
noble lantern
#

Then its a feature

hybrid spoke
noble lantern
#

Sounds like an event for BurchAPI

#

Gets walking and facing direction on move

#

And make it cost

#

25 cents for each listener attached to it

sterile token
#

So wait its possible to get direction?

hybrid spoke
#

or just make a method where you can get the relative face f of location l to players facing pf

sterile token
#

Wait can you can explain in another way

#

Because im so dumb that iu dont understand

#

So i will have to use PlayerMoveEvent get facing block and then?

golden turret
#

difference between to and from

sterile token
golden turret
#

calculate it yourself 😎

hybrid spoke
#

if the player is facing north and the block is west of him you know he pressed a

#

or at least walked to the left

sterile token
#

Hmn who want to do it

#

I can contact someone?

hybrid spoke
#

?services

undone axleBOT
sterile token
#

Oh yes or yes i need to oen a thread?

golden turret
#

no

#

it will open itself

#

sorry but i needed to say

hybrid spoke
ivory sleet
sterile token
#
  • PlayerMoveEvent
  • get facing block
  • difference between to and from
  • if player facing north and the block is west = pressed a
#

Like that?

golden turret
#

yes

sterile token
#

The block i get it from the move event right?

golden turret
#

nop

#

you have 2 getters

#

from and to

#

they are Location

#

you can check their x and z

sterile token
#

And why facing nort and block west give pressed a?

golden turret
#

open your minecraft

sterile token
#

If i dont understand that then i dont know how to calculate pressed b

golden turret
#

face north

sterile token
#

Allright

golden turret
#

press a

#

see what happened

noble lantern
#

With f3 menu looking at coords ^

sterile token
#

I will create new world and test

golden turret
#

looks like i am raging

#

but you will need to do that

#

FOR EVERY FACING

noble lantern
#

You can figure out an algorithm for direction just by looking at indcrements and decrement when moving

golden turret
#

AND CHECK THE RESULTS

hybrid spoke
#

blockfaces have x, y and z

golden turret
#

in this case, only x and z are important

sterile token
#

When i press a = facing north

#

Oh looks a bit diff

noble lantern
#

Thats only for facing direction

#

Not the actual movement of theyre direction

sterile token
#

I just dont know the algorithm i have to use

golden turret
#

just tought

#

waht about

noble lantern
#

If x incremented while z decremented, theyre going north west

hybrid spoke
golden turret
#

player.getVelocity

#

what it does

hybrid spoke
#

they're = they are

noble lantern
#

Doesnt auto correct

hybrid spoke
#

so just write it right

noble lantern
#

Cba

sterile token
#

Cipher so i just need to check when increments and decrements?

noble lantern
#

I spent all of today using my grammar skills in javadocs

golden turret
#

dont doc things

#

use

noble lantern
#

Always doc things

#

Javadocs are important

golden turret
#

getHowManyTimesIPressedTheLetterAToday()

golden turret
#

no need for javadocs

noble lantern
river oracle
#

:/

sterile token
#

So in resoome what do i have to do?

golden turret
river oracle
#

Java docs are useful for the people that use them I am not one of those people thougj

golden turret
#

because its name says what it does

noble lantern
river oracle
#

Sparsely use them for spigot outside of the enums

noble lantern
#

It gives better explanations on what specific methods do

sterile token
#

I already know that i need the MoveEvent, the facing location, the increments and decrements of (i dont know)

noble lantern
#

You can only explain so much in a example

hybrid spoke
#
/** Gets the player */
public Player getPlayer() { return player; }
noble lantern
#

I need to protect and private a lot of that stuff in my javadocs though

noble lantern
eternal night
#

Heyyyyyy

#

some docs are okay

noble lantern
#

I only javadoc things people are meant to use

sterile token
#

So finalizing my topic what do i have to do?

#

Im already listening to move event

crude loom
#

In my plugin, after generating a world and setting the 'doMobsSpawning' gamerule to false, there are still mobs in the world
I assume that this happens because the mobs spawn in the world generation and I need to set the gamerule in the WorldCreator? if so, how do I do that?

golden turret
#

i think that is because the mobs were spawned before you set the gamerule

hybrid spoke
golden turret
#

same thing happens on vanilla

hybrid spoke
hybrid spoke
sterile token
#

But i dont understand and get messed up

#

Please 1 last time so i can understand completly

crude loom
hybrid spoke
#

with the tips we gave regarding BlockFace

hybrid spoke
#

and call #remove

crude loom
#

Ah I see, and was I correct about the reason this happens?

hybrid spoke
#

maybe, maybe not. never really looked into that

crude loom
#

Alright, thank you!

opal juniper
#

@hybrid spoke just spent the last 5 mins trying to use List.of

#

bruh

#

java 8 cringe

spiral aurora
#

^ how do i check if the villager was attacked by a zombie

hybrid spoke
opal juniper
#

it doesnt exist

#

its a java 9 thing

hybrid spoke
#

L

hybrid spoke
#

check if its instanceof Zombie

spiral aurora
hybrid spoke
#

oh well, getKiller is just a player

golden turret
#

getLastDamageCause maybe

noble lantern
#

I spent 5 minutes trying to decide what method name I wanted and I realize dim way overthinking things

hybrid spoke
#

never spent more than 2 mins thinking about a name

#

just refactor it later

noble lantern
#

Ill literally off myself if I have to refactoring this rn

#

I prolly will

#

This data store bs is completely in shambles rn

manic delta
#

looks like something is wrong

golden turret
#

?jd-s

undone axleBOT
manic delta
#

i just can see one parameter here

golden turret
#

yes

#

a string

manic delta
#

i know guy

golden turret
#

the 1st %s is somrthing

#

2nd %s is other something