#help-development

1 messages · Page 1720 of 1

zealous terrace
#

aaah I see it

#

1.8.8s

onyx fjord
#

Sir

zealous terrace
#

still same error tho

onyx fjord
#

API versions are 13+

zealous terrace
#

after fixing

zealous terrace
#

Im coding in a 1.8 server

onyx fjord
#

Don't use 1.8

quaint mantle
#

!!

vagrant stratus
#

remove .8S

quaint mantle
#

Just 1.8

vagrant stratus
#

also ew 1.8

zealous terrace
#

same things

onyx fjord
#

Is it even a valid API version?

zealous terrace
#

it is

onyx fjord
#

I thought it 1.13+

zealous terrace
#

it worked for me

quaint mantle
#

upgrade to new versions, why do you use this old stuff

onyx fjord
#

It works until someone crashes it with one packet

#

:)

quaint mantle
zealous terrace
#

yea it works now

#

but I Still get the postgres error

vagrant stratus
#

Material.STAINED_GLASS_PANE, 1, (short)14
Material.STAINED_GLASS_PANE, 1, (short)5
anyone know what colors these would be in 1.13+?

onyx fjord
#

It's a waste of time to make 1.8 server

zealous terrace
onyx fjord
#

It will run for ~1 day

vagrant stratus
onyx fjord
#

If it's popular

zealous terrace
#

A minigame server mainly depends on combat features, which depend on 1.8

onyx fjord
#

Old combat mechanics exist

zealous terrace
vagrant stratus
#

and nice, no innovation just like most 1.8 servers

#

10/10

onyx fjord
#

5 building blocks

#

69 crash exploits

#

1337 bugs

zealous terrace
#

someone look at this

#

plz

vagrant stratus
#

Need to know 1.13+ Material name

vagrant stratus
zealous terrace
#

at this point its illegal

vagrant stratus
#
  1. Are the files even in the jar
zealous terrace
#

I really dont know

#

me new to ze java

#

im trying to package the dep with the jar

vagrant stratus
#

open the jar....and look for postgres classes, I'm not sure on the path they use but as long as you're not using a shit IDE you can probably find out

zealous terrace
#

nope, its not packaged

zealous terrace
vagrant stratus
onyx fjord
#

In maven you give scope system

#

And then path

vagrant stratus
carmine nacelle
#

Is there a way to get all entities inside of an entityblockstorage? dont see anything

#

and nearby entities doesnt show them.

ivory sleet
#

Use shadowJar plugin

vagrant stratus
#

Material.SKULL_ITEM anyone have any idea what this is?
Is it just the skeleton skull?

#

(dumb pre 1.13 code is dumb)

opal juniper
#

^

tacit drift
#

Probably just a skull in inventory

#

¯_(ツ)_/¯

vagrant stratus
#

Can't wait until this shit's updated and cleaned 👀

#

quite literally most of the errors is legacy material bullshit

opal juniper
#

does it use nms?

vagrant stratus
#

Yea, the material stuff is direct Material calls Material.MONSTER_EGG though.

#

it's 2016-2017 code

opal juniper
#

that’s not nms lol

vagrant stratus
#

Yea i know

#

it does use NMS though lol

#

so.. that'll be hell

opal juniper
#

ah

#

have fun!

vagrant stratus
#

I will

#

....no fucking clue what I'll replace Material.MONSTER_EGG with though 😐

#

like... the fuck..

opal juniper
#

better go get yourself a de obfuscated decompiled jar

vagrant stratus
#

Fuck backwards compat lol

#

It'll be 1.16.5+

opal juniper
#

yeah but you won’t know what the fields are is what i mean

#

they are obfuscated now

vagrant stratus
#

not reflected lol

#

very useful site

opal juniper
#

huh - no that’s not what i mean. when you go to say CraftPlayer - all the fields and methods are named like ,a,b,c cause they are obfuscated- so any nms work becomes a chore as unless you can use the return type you have to look them up

vagrant stratus
#

Not really the case here, to an extent anyways. It's not super heavy NMS

opal juniper
#

right ok

vagrant stratus
#

In other news, i still have no fucking clue what Material.MONSTER_EGG is

opal juniper
#

it’s the spawn egg

#

creative one

vagrant stratus
#

Yes... I'm aware..
There's 392423904390 now

#

I'm not even sure you can get a generic spawn egg 👀

opal juniper
#

nope

#

you will have to look at the context and pick the best one ig

vagrant stratus
#

this just in:
Fuck anything below 1.13 even more

#

Everything says it's fucking stone, really?

#

REEEE

#

thank fuck i have 1.12 and below jars

#

MONSTER_EGG(383, 64, (Class<? extends MaterialData>)SpawnEgg.class),

#

1.12.2

#

383 being the id

opal juniper
#

what the hell are you doing lol

vagrant stratus
#

first i need to find a very that accepts ids for /give ejfreiowjrioewjrfeiofjrioejrteiotjie4tior

#

383... literally just a general spawn egg... the fuck

#

#GonnaHopeForTheBest

#

WOOD_DOUBLE_STEP(125, (Class<? extends MaterialData>)Wood.class), the literal fuck

#

@opal juniper BRUH

#

the fuck

tacit drift
#

you fricked minecraft

vagrant stratus
#

I had to go back to 1.7.10 for this shit, and it's useless

#

the literal fuck is this shit

zealous terrace
vagrant stratus
#

google

opal juniper
vagrant stratus
#

WHY

ivory sleet
tacit drift
#

java 69

zealous terrace
# ivory sleet https://github.com/Conclure/cityrp-core/blob/master/build.gradle.kts <@!70652908...

Could not determine the dependencies of task ':compileKotlin'.

Could not resolve all files for configuration ':kotlinCompilerClasspath'.
Cannot resolve external dependency org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.61 because no repositories are defined.
Required by:
project :

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 419ms

#

Great, Bukkit is broken now

ivory sleet
#

Did u copy mine literally?

zealous terrace
#

no

#

I modified a bit

#

here it is

ivory sleet
#

anyways assume you're having kotlin as a dependency

#

you'd need a repo pretty sure

zealous terrace
#

wdym

#

bruh im dumb, I removed kotlin dep

#

great I dont know how to add it back now

ivory sleet
#

if u use intellij just go to history

#

then local history

#

and check

zealous terrace
#

I never had a kotlin dependency to begin with

ivory sleet
#

idk

#

I cant tell much without seeing ur buildscript

#

well

zealous terrace
ivory sleet
#

ur entire project setup would be good if I could have a look at

zealous terrace
#

this is my build script ^^

ivory sleet
#

Well you must have changed?

zealous terrace
#
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
    id("java-library")
    id("com.github.johnrengelman.shadow") version "7.0.0" apply (false)
}

group = "com.rithulk"
version = "1.0"
description = "ranks"
java.sourceCompatibility = JavaVersion.VERSION_17



subprojects {
    apply(plugin = "java-library")
    apply(plugin = "com.github.johnrengelman.shadow")

    java.toolchain.languageVersion.set(JavaLanguageVersion.of(16))

    this.buildDir = File(rootProject.buildDir,this.name)

    repositories {
        mavenCentral()
        mavenLocal()
        maven {
            url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
        }

        flatDir {
            dirs(
                File(rootProject.rootDir,"libs"),
                File(rootProject.rootDir,"libs/cache"),
                File(rootProject.rootDir,"libs/plugins")
            )
        }
    }

    dependencies {
        implementation("org.postgresql:postgresql:42.2.24.jre7")
        compileOnly("org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT")
        implementation("org.jspecify:jspecify:0.2.0")
    }
}
ivory sleet
#

yes and that wont work

zealous terrace
#

why

ivory sleet
#

because you copy pasted it

zealous terrace
#

uhh

#

I modified some too

ivory sleet
#

thats not what matters

#

anyways when I said add shadowJar plugin

#

I didnt mean copy paste my build.gradle.kts

#

just add the plugin

#

id("com.github.johnrengelman.shadow") version "7.0.0" apply (false)

#

one line

zealous terrace
ivory sleet
#

no you can probably remove it

#

it means it should be added to the project but not applied to the project

zealous terrace
#

bruh still the postgres jdbc mf is not in hte org folder

ivory sleet
#

probably because you did something wrong

zealous terrace
#

wait I see it

#

I think

#

IT WORKS

#

THANKS A LOT CONCLURE

#

im too happy sorry

#

it took a whole friggin day

#

now I gotta look at how to compile the jar in a seperate folder so that I dont have to move it every time

ivory sleet
#

ok hav a gret tam

zealous terrace
#

u have any idea? xD

ivory sleet
#

uh

#

make a copyJar task

zealous terrace
#

ok

ivory sleet
#

which is executed after shadowJar

zealous terrace
ivory sleet
#

gif embed fail :p

vagrant stratus
#

@opal juniper i take it back, there is NMS pain 😐

#

has to do with villagers

#

public VillagerNMS(EntityTypes<? extends EntityVillager> entitytypes, net.minecraft.server.v1_16_R3.World world) {

entityTypes, what, if anything gets passed to that 🤔

chrome beacon
#

People have already helped you though

#

And you shouldn't be designing a plugin like you would with command blocks

outer steeple
#

i have over 100 items on my server that are made and work with commands i cant just start over

chrome beacon
#

You probably should for performance

#

But fine if you don't want to... what do you still need help with

outer sorrel
#

Im making a leaderboard for stats that doesnt let me choose what position to get (Like get 1st place or 5th place of %statistic_mob_kills%)
what would be the best way to do it myself?
i want to do it with a bunch of different stats from different plugins
using PlaceHolderAPI

outer steeple
#

my(Lions_lmao) score is 1 as seen on the sidebar but when i try to run a test that detects if my score is 1 it fails.

chrome beacon
outer steeple
#

thats my problem

chrome beacon
#

Plugin scoreboard might be different from the one vanilla uses 🤷‍♂️

#

You might as well just force the player to run a command

outer sorrel
#

also should I do it as a PAPI extension or as an actual plugin?

outer steeple
#

oh boi over 100hours lost yayyyyyyyy i want to dieee

chrome beacon
#

Plugin

outer sorrel
#

ok thanks

outer steeple
#

i just realized i dont even know how to make the items with just plugins. im just frustrated at this point.

#

How to give score to the player?

echo basalt
#

I believe you gotta teleport after spawning it in

vagrant stratus
#

my pain is now schematic bullshit since this is all pre 1.13

echo basalt
#

The generic type requirement is there because there are multiple classes that extend it

vagrant stratus
#

reallllly hoping XMaterial can help here lol

echo basalt
#

I believe I had to find this out because zombies

vagrant stratus
#

It's working off ids instead of how things are done now

#
              block.setType(Material.getMaterial(iduri.get(loc)));
              block.setData(data.get(loc));
              block.getState().update(true);
              block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getTypeId());
#

so I'm gonna just chuck XMaterial into the plugin and hope for the best lol

echo basalt
#

are you updating a plugin or something

vagrant stratus
#

Yea

echo basalt
#

You better be getting paid good to be updating tons of NMS on a plugin to 1.13+

vagrant stratus
#

It's not tons of NMS actually

#

and the above code doesn't touch NMS at all

#

and I'm doing it myself cause it would be nice to have this resource available on newer versions 👀

#

I wouldn't need XMaterial, but i cba to update this single class to work with how it's done now

#

mainly because i dunno how 👀

echo basalt
vagrant stratus
#

I half-assed it with XMaterial it's fiiiiiiine

#

just need to deal with the NMS stuff though.
It just seems like they're making it so the villager doesn't move however, so i don't think NMS is needed at all anymore lol

#

nvm, they have modified pathfinder goals

#

I'll need to look into it when i get up though

quaint mantle
#

how to apply this to an entity

#

Wait, i need to ask you guys this:
so you guys have a way to increase the variables as a way to count time (like each 20 ticks increase by one, yeah), but when we stop the server, is the variable still have the same variable when start the runnable again?

young knoll
#

No

opal juniper
#

what are you even doing @vagrant stratus

tribal holly
#

what the hell is this method ? getI18NDisplayName

#

i try to get display name of an item (bukkit one)

#

and the method is just name like this

young knoll
#

“In computing, internationalization and localization or internationalisation and localisation, often abbreviated i18n and L10n, are means of adapting computer software to different languages, regional peculiarities and technical requirements of a target locale.”

quaint mantle
#

how to search for a code in a project in intellij

#

i googled and found nothing

subtle kite
#

ctrl + f ?

lost matrix
quaint mantle
#

i use pdc for storing data

#

and that is nms

stone sinew
vagrant stratus
stone sinew
#

Yeah I have an exists method in mine instead of valueOf so it returns stone in stead of NPE. But outputs if it's missing. But that's about it.

vagrant stratus
#

Meh, cba to update the class since it handles schematics.
Once i rewrite it so it's not shit perhaps I'll just make W.E. a dependency if i can implement it in the same way

stone sinew
#

I got my own schem system to lol

vagrant stratus
#

I'm working off pre-made schems & code, not really an option to make both from scratch

#

I'm stuck with pre 1.13 schems afaik

stone sinew
#

Block physics are fucked up in 1.17.1 though so it's hard to keep portals and shit lit. Or sand from falling.

opal juniper
gusty bough
#

Having problems to get nbt tags shown in a HoverEvent, any idea how to fix it?

hevent = new HoverEvent(HoverEvent.Action.SHOW_ITEM, new Item(item.getType().getKey().getKey(), 1, ItemTag.ofNbt(jsonItem)));
#

Only the name of the item is shown

crude charm
#

Check their yaw

#

aight thanks

#

yeah ik

#

still getting an error

#

idk if it's exactly what u sent but it should work

severe prism
#

i know iam not supposed to ask about the version 1.17/1.18 here but how can i send Bungee TextComponents to a spigot player, because i dont see any .spigot() method or spigot class in the player class itself. Any Ideas?

torn vale
#
                                    ent.setVelocity(ent.getLocation().getYaw(new Vector(3, 3, 3)));

idk how to use vector so how can i throw the player away from hiw direction?

unkempt peak
#

Just reverse the player's deriction and then multiply it

#

And use that as the velocity

torn vale
#

its hurting to say that but could you send me the code so it works?

unkempt peak
#

I'm on my phone but you could multiply the x y and z by -1 to reverse it then you can just use direction#multiply and multiply it by something like 5

torn vale
#

kk

unkempt peak
#

Then you can use that vector directly in setVelocity

torn vale
#

👍

hasty jackal
crude charm
hasty jackal
#

well the runtime isn't know to be funny and just randomly change values, there's something that you're doing that you either (accidentally) set it to null or you're using two independent objects

crude charm
#

Yet it doesn’t work

hasty jackal
#

well if you can share some cohesive piece of code I could tell you what could be wrong

crude charm
#

I can’t tho it’s 1am and I’ve decided to go to bed I have explained everything I am doing and sent all the code that has ANYTHING to do with the enum sending more won’t change anything

hasty jackal
#

¯_(ツ)_/¯

crude charm
hasty jackal
#

am I missing something because I don't see that in any of the pastes

crude charm
hasty jackal
#

well that can't be true, because otherwise eventManager would give you an undefined error

crude charm
#

Apart from obv and instance of the manager

hasty jackal
#

that is the important part

crude charm
#

I’ll write what I did Rn

#

1s

hasty jackal
#

if you have a new EventManager() in that instance of the code

#

and the same in the other part

#

those two instances are distinct from each other

crude charm
#

Private Manager manager;

Public joincommand(manager manager) {
This.manager = manager
}

quaint mantle
#

Why did i get banned?

#

I did nothing

crude charm
#

Ignore caps I’m on phone

crude charm
#

@hasty jackal

hasty jackal
#

I mean that looks good, so do the other parts

#

but depending on how those are stitched together I can still think of ways for it to go wrong

#

obviously also how it could go right, but I can't tell because that's all that I'm working with

crude charm
#

What other parts? That is everything in that class

hasty jackal
#

and how is it used?

crude charm
#

Then for the other classes same thing, that is everything related to it in any way

hasty jackal
#

how does the plugin class create these?

crude charm
#

Everything else is TOTALLY unrelated in every way

crude charm
hasty jackal
#

not it's not. if you do this.getCommand("command").setExecutor(new joincommand(new Manager())) it would fail

#

because new Manager() -> new instance -> definitely different from what you're working with -> does not have status set -> NPE

#

that's why it matters how you're setting things up

crude charm
hasty jackal
#

if that is exactly what you're doing, you need to ensure that you don't create multiple Manager instances, instead creating one and passing that one around

crude charm
#

Oh you@edited

#

Yeah

hasty jackal
#

that would be an option

crude charm
#

Anything else if that doesn’t work

hasty jackal
#

uuhh the alternative is fixing whatever else is broken for that to not work

crude charm
solar sable
#
public class MeowCommand implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (cmd.getName().equalsIgnoreCase("Meow")){
            Player p = (Player)sender;
            if (sender instanceof Player) {
                p.sendMessage(ChatColor.translateAlternateColorCodes('&',"Playing cat meowing sound"));
                p.playSound(p.getLocation(), Sound.ENTITY_CAT_BEG_FOR_FOOD, 2F, 1F);
                return true;
            }
        }
        return true;
    }
}
``` how to fix this? it doesnt send the message and doesnt make the sound
opal juniper
#

and

#

is it registered?

#

are there errors

solar sable
#

no error

#

just warning

hasty jackal
#

I feel like we've discussed that exact piece of code before

onyx shale
#

warning comes from the instance check...

#

whats the point of checking if sender is instance of player if you are already casting it to a player just above..

#

also anyway thats not the problem,how do you register the command

haughty nexus
#

Getting back to Spigot development after some time, heard there's now the possibility to have full 24 bit color in chat. That works, but for some reason not in the Tablist. Is it not supported there?

onyx shale
#

almost everything should support hex colors

#

dont see why tablist shouldnt

haughty nexus
#

Hmm then im doing it wrong

#

Maybe it doesn't work because i use Papers new shitty Component API

lusty cipher
opal juniper
#

its just different

#

anyways

ivory sleet
#

It’s actually good

opal juniper
#

ChatColor supports hex

haughty nexus
#

Yeah it does now

ivory sleet
#

It always have I’m pretty sure

opal juniper
#

i forget whether it is only md_5 one

ivory sleet
#

Well

opal juniper
#

or bukkit one too

haughty nexus
#

i put this

#

and get this

#

im on 1.16.5

#

but it works in chat

#

:thonk

#

Let me try to not use kyori.adventure

crimson terrace
haughty nexus
#

Yes

#

Why did they add it

#

It's so fucking stoopid imo

crimson terrace
#

ye

haughty nexus
#

Especially because ClickEvents etc don't work in the tablist :5head:

#

Oh surprise it works when i use the "deprecated" function Bukkit has been using for 10 years

tardy delta
#

build project?

haughty nexus
#

Yes

tardy delta
#

oh test german tomorrow

haughty nexus
#

Our whole school is making a build project where we build the school in minecraft, and i'm in charge of setting up the server :sadge:

tardy delta
#

o

#

you lucky dude

haughty nexus
#

HTL stands for Höhere Technische Bundes- Lehr und Versuchsanstalt

haughty nexus
#

But it's on a flat map with 300 block worldboarder so should be fine

tardy delta
#

😳

haughty nexus
#

i hope...

tardy delta
#

pff still haven't figured out what the problem with my gui class is after days

hasty prawn
#

What's the problem

tardy delta
#

its kinda difficult to explain

#

the point is i an action for some slots and they wont work because my inventory id is null

#

i can show the classes maybe that helps

hasty prawn
#

Yeah that would help, since I have no idea what that means

tardy delta
#

?paste

undone axleBOT
tardy delta
hasty prawn
#

Okay, and what's not working exactly?

tardy delta
#

well if you look at the listener action.click executes the action linked to the slot, that works, except when the action is to open a new inventory, then the actions dont work

hasty prawn
#

Oh, try delaying the openInventory

tardy delta
#

hmm i think the action isnt registered

#

i'll try

solid cargo
#

why do the drops mix

#

code incoming

#

like, if i kill a creeper, it can also drop arrows

hasty prawn
solid cargo
#

wdym by that

hasty prawn
#

Like, another EntityDeathEvent is probably dropping the arrows.

solid cargo
#

but like

#

how

#

if im just killing a creeper

#

how can the game think im killing a skeleton

hasty prawn
#

It doesn't, that's why it's probably a different method.

solid cargo
#

hmm

#

is it me being dumb in my code?

#

or is spigot a being dumb?

hasty prawn
#

I can almost guarantee you, it's not Spigot.

solid cargo
#

but then

#

how do i fix it

#

idk its telling me this thing

#

but i think it wont fix anything

hasty prawn
#

getKiller() returns a Player

#

So it's telling you to null check instead

stone sinew
#

The killer can be any entity though???

hasty prawn
#

Not according to getKiller()

solid cargo
#

but that wont fix the problem will it?

hasty prawn
#

You have to use EntityDamageByEntityEvent if you wanna determine any other entity afaik

stone sinew
#

So if a skeleton kills a creeper it won't return a skeleton?

hasty prawn
hasty prawn
stone sinew
#

BROKEN!

solid cargo
#

could it be cause my public void onSomething is equal in all clasees?

#

this thing

hasty prawn
#

As long as they're in different classes it doesn't matter

solid cargo
#

oh waitttt

haughty nexus
#

Has anyone tried working with the generator-settings property in server.properties in 1.16? It changed in 1.16, now accepts json, but not even the json from an minecraft employee works

solid cargo
#

before i found out you can just use else if (random == whatever)

#

i just made an int for every like uh

#

item

#

could that be it?

haughty nexus
#

It does that automatically

hasty prawn
#

Does it? PauseChamp

haughty nexus
#

Yeah, but maybe it only does after trying to load it, i'll try starting 2nd time

hasty prawn
haughty nexus
hasty prawn
#

And it still didn't work the second time?

haughty nexus
#

let me try

#

still the same

hasty prawn
#

Looks like it's a bug

haughty nexus
#

Very nice

haughty nexus
#

im on 1.16.5

#

guess ill just drag the world form singleplayer

#

thanks though

hasty prawn
#

Ah, wait

#

I think it got fixed.

solid cargo
#

pretty sure i fixed it

hasty prawn
haughty nexus
#

Ah

#

thank you

#

let me try that

#

Oh lmao thats exactly the one i tried

#

from the mojang employee

hasty prawn
#

What are you putting into your server.properties

stone sinew
#

I found my issue with ItemStack.deserialize(Map<String, Object>) Unless I am reading this wrong...
If the map has enchants it won't add the itemmeta

if (args.containsKey("enchantments")) {
    raw = args.get("enchantments");
    if (raw instanceof Map) {
        Map<?, ?> map = (Map)raw;
        Iterator var9 = map.entrySet().iterator();

        while(var9.hasNext()) {
            Entry<?, ?> entry = (Entry)var9.next();
            Enchantment enchantment = Enchantment.getByName(entry.getKey().toString());
            if (enchantment != null && entry.getValue() instanceof Integer) {
                result.addUnsafeEnchantment(enchantment, (Integer)entry.getValue());
            }
        }
    }
} else if (args.containsKey("meta")) {
    raw = args.get("meta");
    if (raw instanceof ItemMeta) {
        ((ItemMeta)raw).setVersion(version);
        result.setItemMeta((ItemMeta)raw);
    }
}
haughty nexus
haughty nexus
#

fails on 2nd start with this

stone sinew
#

Welp. Gotta just make my own xD

haughty nexus
#

When i drag the world from singelplayer onto the server, do i need to load the chunks or does the world generator understand it's not a normal flatmap?

#

Funnily enough it even throws an error when i leave the generator-settings field empty

hasty prawn
haughty nexus
#

who tested this and thought "yeah this throws an error in the console but who cares" and released it

#

:thonk:

#

Also why can't i use external emotes here

#

:3Head:

hasty prawn
#

You have to boost to use them

haughty nexus
#

pff

hasty prawn
#

But yeah I have no idea why that setting is so finicky

#

At that point I wouldn't even trust it

haughty nexus
#

Yeah it throwed that error the first time i started the server and thought i fucked up

#

didn't know what it meant though

#

God even the Discord API is more predictable than this

#

:kekw:

tidal geode
#

Hello, is this support?

eternal oxide
#

That depends on the type of support

#

but probably not

tidal geode
#

ahahahaha

stone sinew
#

Ok... so

if (map.containsKey("meta")) {
    raw = map.get("meta");
    result.setItemMeta((ItemMeta) raw);
}
```Doesn't even work lol
God I was really trying not to have to write my own serialization methods lol
eternal oxide
#

There is no constructor for ItemMeta outside of the ItemFactory

stone sinew
civic apex
#

Are tools? (Like a diamond pickaxe) shaped recipes?

young knoll
#

Yes

civic apex
#

And Diamond shovel?

young knoll
#

Yes

civic apex
young knoll
#

Still shaped, but it's 1 wide so it can be crafted in any column

civic apex
#

Huh

#

I made a craft checker and día shovel doesnt work

#

Shears dont work either

civic apex
#

how does the shears recipe work

tacit drift
#

uh?

#

wdym

quaint mantle
#

I'm a bit confused on how to create scoreboards in plugins, any help?

solar sable
#

because if you're asking on how to make it, its a bit hard to tell so might should just use youtube

quaint mantle
#

my brain died trying to read that sentence but ok

solar sable
#

sorry lol

#

what i mean is just go to youtube and search "how to code a scoreboard using spigot" and it will pop up trust me lol

quaint mantle
#

personally dont feel like im learning anything when watching a tutorial, would rather get an idea from other people and then do it myself rather than copying it from a tutorial that wastes my time

quaint mantle
#

idk what ur talking about

normal vortex
#

Google

quaint mantle
#
        Team noNamers = board.registerNewTeam("noNamers").setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);

The code gives me this error:

eternal oxide
#

its not a builder

ashen flicker
#

Honestly man I’d say don’t do it, it’s not worth the time. Just use placeholder api and feather lard.

#

Featherboard*

quaint mantle
#

I dont like using api's in my own plugins

normal vortex
quaint mantle
ashen flicker
#

I’m against re making utility plugins unless you absolutely have to

#

Remaking plugins that actually affect the player experience, that does matter imo

eternal oxide
#

you can;t chain

quaint mantle
#

adding a bunch of apis and libraries will get messy

trail oriole
#

Hello

ashen flicker
#

I understand what you’re saying, but if you start trying to make your own permissions or worldedit, to me I think that’s really not necessary. And I think the same really applies to any utility plugin that exists. But I get why you want to do that.

trail oriole
#

how do i check if an arg in a command is equal to a player's name ?

#
if (args[0] == Bukkit.getOnlinePlayers()) {
                    
                }```here's what i tried
#

which doesn't work

young knoll
#

Bukkit.getPlayer(String) != null

ashen flicker
#

It’s a string array, so you’d determine which part of the array you want to check. If args[0].equalsIgnoreCase(name)

#

But if you want a player instance from args don’t do it like that

trail oriole
#

oh ?

ashen flicker
#

Player player = Bukkit.getPlayer(args[0]);

trail oriole
#

yeah but args[0] isn't always a player

ashen flicker
#

Then check if the player is null or not before using it, or just use a try catch if you don’t like null checks

young knoll
#

Don't use a try catch over a null check

ashen flicker
#

no it’s not that was an example, it’s however your command is set up. You should use a try catch absolutely if there’s gonna be a lot of null checks

young knoll
#

Relying on exceptions when you can avoid them is bad form

#

And exceptions aren't cheap to throw

ashen flicker
#

That’s not true at all, I generally wrap my entire commands with a try catch through my command api

young knoll
quaint mantle
ashen flicker
#

I dunno I’m reading a book called “clean code” and the error handling section says basically the opposite

#

Unless I’m not understanding it correctly

eternal oxide
#

exceptions are best avoided, if you can, however the performance has greatly improved recently.

young knoll
#

You mean now that we aren't stuck in Java 8 purgatory

trail oriole
#

?

quaint mantle
#

16+

eternal oxide
#

not unless you have to.

quaint mantle
#

did 17 really add anything other than support for different OS

eternal oxide
#

I believe it aded a nice new switch feature

trail oriole
#

well i code in java 8

#

when i used 16 i got a compiler error in mu plugin when loading it

quaint mantle
#

because it has to be minecraft 1.17

young knoll
#

Or 1.16.5

trail oriole
#

i code mc 1.16.5

#

wait

eternal oxide
trail oriole
#

no

tacit drift
#

wrong exprimation dude

trail oriole
#

develop plugins for mc 1.16.5

young knoll
#

The latest spigot release for 1.16.5 should support java 16

quaint mantle
trail oriole
#

it didn't yesterday ^^'

eternal oxide
#

preview. its in release 17

lavish hemlock
#

JEP-406 is great

but you should just use Kotlin anyways

quaint mantle
#

shutup

trail oriole
#

anyways how the hell does this works java if (Player player = Bukkit.getPlayer(args[0]))

young knoll
#

I

lavish hemlock
#

it doesn't

young knoll
#

What

trail oriole
#

i tried what you guys told me

lavish hemlock
#

that is an expression, but it is semantically incorrect as that expression does not have a boolean type

young knoll
#

No one told you to do that

trail oriole
#

i'm dumb

lavish hemlock
#

ohhh you're a beginner

#

don't do that, that's not correct

trail oriole
#

i just wanna check if args = onlinePlayerName

tacit drift
#

if (Bukkit.getServer().getPlayerExact(args[0]) != null))

trail oriole
#

getPlayerExact or getOnlinePlayer ?

tacit drift
#

getPlayerExact

trail oriole
#

may i ask why ?

tacit drift
#

it matches for the player with that exact name

#

it's null if the player is not online/not found

trail oriole
#

dumb question

young knoll
#

What is the difference with getPlayerExact anyway

tacit drift
lavish hemlock
#

that does not explain much

#

mainly as "exact name" isn't defined

quaint mantle
#

shouldn't it be reversed

lavish hemlock
#

especially since "case insensitive" suggests that it's slightly inexact

young knoll
#

¯_(ツ)_/¯

quaint mantle
#

getPlayer -> case insensitive
getPlayerExact -> case sensitive

#

doesnt make sense

lavish hemlock
#

why even have a case sensitive version?

quaint mantle
#

i dont know

young knoll
#

To the source

tacit drift
#

names are case insensitive anyway

lavish hemlock
#

just put the case sensitivity responsibility on the API user

tacit drift
#

there can't be a Ben and ben for eg.

lavish hemlock
#

lmao

#

jesus christ this API is a mess

quaint mantle
#

so many unneeded methods

tacit drift
#

backwards compatiblity

lavish hemlock
#

unneeded methods, poor documentation, out-of-datedness

quaint mantle
lavish hemlock
young knoll
#
    @Override
    @Deprecated
    public Player getPlayerExact(String name) {
        Validate.notNull(name, "Name cannot be null");

        EntityPlayer player = playerList.getPlayer(name);
        return (player != null) ? player.getBukkitEntity() : null;
    }
#

vs

lavish hemlock
#

if they truly cared about backwards compatibility, NMS would have proper mappings

young knoll
#
 @Override
    @Deprecated
    public Player getPlayer(final String name) {
        Validate.notNull(name, "Name cannot be null");

        Player found = getPlayerExact(name);
        // Try for an exact match first.
        if (found != null) {
            return found;
        }

        String lowerName = name.toLowerCase(java.util.Locale.ENGLISH);
        int delta = Integer.MAX_VALUE;
        for (Player player : getOnlinePlayers()) {
            if (player.getName().toLowerCase(java.util.Locale.ENGLISH).startsWith(lowerName)) {
                int curDelta = Math.abs(player.getName().length() - lowerName.length());
                if (curDelta < delta) {
                    found = player;
                    delta = curDelta;
                }
                if (curDelta == 0) break;
            }
        }
        return found;
    }
lavish hemlock
#

what ze fuck

quaint mantle
#

what...

trim creek
lavish hemlock
#

(also they're both deprecated??)

tacit drift
#

😕

young knoll
#

The impl is

#

I imagine the api method isn't

quaint mantle
#

theres no way the dev actually though that was good code

lavish hemlock
#

the power of Bukkit/Spigot code!

quaint mantle
#

this is bukkits fault

young knoll
#

Yep the api methods are not deprecated

quaint mantle
#

but shouldve been changed

lavish hemlock
#

you see why I find the API shit now?

young knoll
#

🙃

tacit drift
#

yeah anyway, ima get back to my math hw, bye

trail oriole
#

Shouldn't if (args[1] == null) wprk ?

young knoll
#

We basically ditched most of the API over at OTG

trail oriole
#

not looking for a player

quaint mantle
trail oriole
#

just an empty arg

quaint mantle
#

there cannot be an empty arg

lavish hemlock
#

check the length of args

trail oriole
#

if there is not arg

young knoll
#

Check args.length

trail oriole
#

oh like arg.length < 1

lavish hemlock
#

if [1] doesn't exist in the array, it will throw an exception on access

#

yes

trail oriole
#

is the first arg counted as 0 here too

#

?

young knoll
#

yes

lavish hemlock
#

yes

quaint mantle
#

yes

errant drift
#

Yes

trim creek
#

yes

young knoll
#

Indexes always start at 0 with java

quaint mantle
#

lua: 🤡

trim creek
#

🤣

lavish hemlock
#

lua is very 🤡

opal juniper
#

lua just built different

young knoll
#

Never got used to that

#

Terrible

young knoll
quaint mantle
#

startsWith

#

ryan
ryanA

#

Yep!

young knoll
#

Ah

errant drift
#

ImagineDev

lavish hemlock
#

WAIT WAIT WAIT

quaint mantle
#

it might be sorted, but still why

lavish hemlock
#

THAT'S A FUCKING STARTSWITH CHECK!?

quaint mantle
young knoll
#

I guess it makes sense, I do like using essentials /tp

lavish hemlock
#

AAAAAAAAAA

young knoll
#

Since you can just enter the first few letters

trim creek
#

Did maowcraft just died or something...?

young knoll
#

Think so

trim creek
#

MAOW! ART THOU OK?!

#

M~...

#

Maow...?

#

Yes. I think they died.

#

Rest in Peace

quaint mantle
#

on another topic, how would twitch even leak their entire database

trail oriole
#

ok now it works but doesn't...

trim creek
#

Once ya acces yer phpmyadmin, ya have rights for all yer databases 🤣

trail oriole
#

like no errors but doesn't work

quaint mantle
#

first Mark lizard internal error, then twitch database leak

#

i cant wait to see twitch get sued so badly they have to shutdown

lavish hemlock
quaint mantle
#

😂

lavish hemlock
#

also wow

#

someone actually calling me by the correct name

#

Maow

quaint mantle
#

moaw

trim creek
#

HAHAA! 😄

lavish hemlock
#

I applaud you

trail oriole
#
if (Bukkit.getPlayerExact(args[1]) != null) {
                        Player p = Bukkit.getPlayerExact(args[1]);
                        String name = p.getName();

                        ItemStack playerHead = new ItemStack(Material.PLAYER_HEAD);
                        SkullMeta phMeta = (SkullMeta) playerHead.getItemMeta();

                        phMeta.setOwner(name);
                        phMeta.setDisplayName(ChatColor.GOLD + name);
                        playerHead.setItemMeta(phMeta);

                        inv.addItem(playerHead);``` anyone explains ? it has no errors but doesn't add the head to inv
trim creek
#

Thank you! 😄

quaint mantle
young knoll
#

Looks like it was an internal breach?

paper viper
trail oriole
paper viper
#

Then a hacker really wanted to get revenge

quaint mantle
#
Player player = Bukkit.getPlayerExact(args[1]);

if (player == null) {
    sender.sendMessage(ChatColor.DARK_RED + "That player is not online!");
    return true;
}
// Code

@trail oriole

paper viper
#

Then they posted on 4chan and stuff

#

So

quaint mantle
#

how are twitch streamers complaining about pay

#

they never get dmca'd, they can put 15 ads if they wanted to

young knoll
#

9m over 2 years

#

Pretty good if you ask me

stone sinew
quaint mantle
#

teams are not working i made a team manually with commands, changed the name tag visibilty to never and it still doesnt work pls help

quaint mantle
#

you can stream it but not save it publically

stone sinew
#

But now Twitch has a contract with some music company so that might go away soon.

paper viper
quaint mantle
#

get popular

paper viper
#

I mean, they do work pretty hard

quaint mantle
#

you arent gonna make full time with 10 viewers 💀

#

Teams not working scoreboards

young knoll
#

Seems weird that you can stream copyrighted music but not have it saved

stone sinew
quaint mantle
young knoll
#

Guess they don't want people using twitch vods to make a playlist

quaint mantle
#

that too probably

young knoll
#

I feel like that would be way too much effort to avoid giving the artist's money

quaint mantle
#

woah this is a dev chat not a talk about streamers chat

#

google: shutdown discord bot for music
google: never show music ads in google search

Stonks

quaint mantle
young knoll
#

The dump also reportedly contains Unity source code for a game called "Vapeworld."

#

Dank

paper viper
#

Anyways I do have a twitch account. I added 2FA to it

quaint mantle
solar sable
#

Im watchin TechnoVision teaching me how to create custom items and for the next video im gonna see the custom recipe

paper viper
#

No

solar sable
#

wait this the dev chat-

#

my bad

paper viper
#

Please no

#

TechnoVision

#

Is so bad

#

God no

quaint mantle
#

all the youtubers suck

#

Agree

#

besides kody, they arent as bad

paper viper
#

TechnoVision is like the alpha worst male

quaint mantle
#

kody is alright i watch him the most

trim creek
#

What about Rolix? .-.

#

Or Pamkutya..? .-.

paper viper
# trim creek Why they do...? .-.

Because they tell you to copy and paste code without understanding it, and usually it follows very bad conventions, unnecessary code

#

And a lot of other stuff

stone sinew
#

Anyone else notice the only youtube videos about coding for spigot is just copied and pasted from spigot threads? Never see any original code in those tut videos.

young knoll
#

I wonder if the youtuber I watched 8 years ago is still around

#

Shame I don't quite remember the name

quaint mantle
trim creek
#

If ya'll say so

trail oriole
#

still doesn't work

#
if (args[0].equalsIgnoreCase("open")) {
                        player.openInventory(inv);
                    }
                else if (args[0].equalsIgnoreCase("add")) {
                    
                    if (args.length < 2) {
                        sender.sendMessage("§8[§6BingoBook§8] §cIncorrect syntax");
                        sender.sendMessage("§8[§6BingoBook§8] §fUse /bingobook to see the command list");
                        return true;
                    }
                    Player p = Bukkit.getPlayerExact(args[1]);
                    if (p != null) {
                        String name = p.getName();

                        ItemStack playerHead = new ItemStack(Material.PLAYER_HEAD);
                        SkullMeta phMeta = (SkullMeta) playerHead.getItemMeta();

                        phMeta.setOwner(name);
                        phMeta.setDisplayName(ChatColor.GOLD + name);
                        playerHead.setItemMeta(phMeta);

                        inv.addItem(playerHead);
                    } 
                    else {
                        sender.sendMessage("§8[§6BingoBook§8] §cPlayer doesn't exist");
                    }```
#

sent a huge part of the code

#

but it's annoying

#

it won't add the head to the inv

#

plus i don't know how to make the inv global

quasi flint
#

Save the inventory into an public variable?

trail oriole
#

well that isn't really what i need

ivory sleet
#

Don’t make it global though, just pass it to the class needed as a dependency

quasi flint
#

Then what's the thing u need

trail oriole
#

global throughout the players, so that if you add a player through /add command, everyone has it in their inv when doing the command to open that inv

ivory sleet
#

Map some inventories ma buddy

#

Map<UUID,Inventory> or something where the players unique id acts like key

trail oriole
#

is this advanced java ?

#

i'm a beginner

quaint mantle
#

no

trail oriole
#

and this is confusing ^^

ivory sleet
#

It’s a data structure you’ll have to learn sooner or later, especially in spigot/minecraft context

trail oriole
#

but can i fix the issue before adding some more advanced java stuff ?

#

like please explain

#

i'll dig in mapping right afterward

ivory sleet
#

If scarcely know the basics of Java, then the obvious is to tackle that first

#

?learnjava these links can get you started

undone axleBOT
trail oriole
#

on mapping ?

young knoll
#

On anything

ivory sleet
#

Java basics generally

young knoll
#

Is bytecode manipulation included?

trail oriole
#

i kinda have the basics

ivory sleet
#

No

young knoll
#

Terrible :p

ivory sleet
#

Then learning the Map structure shouldn’t be too difficult to learn

trail oriole
#

can you guys just help me with inv.addItem(playerHead); that isn't working ?

#

i usually learn on my own and ask when it's messed up xD

ivory sleet
#

?paste the full class first and foremost

undone axleBOT
trail oriole
#

that link should somehow work ?

ancient plank
#

class naming 101

young knoll
#

At least it isn't just Main

trail oriole
#

is it not optimized ?

#

i mean of course not

ivory sleet
#

Extract the variable to outside the method

#

Specifically inv

#

You see, in there you create a new inventory every time

#

So it won’t stay persistent

young knoll
#

On today's lesson, Variable Scope

ivory sleet
#

^

#

Second, format your code, it helps everyone see what the if and else statements do and so on

#

It should be a function in your ide if you use one

trail oriole
#

i use eclipse

young knoll
#

ctrl shift f

trail oriole
#

oh

#

yeah

#

that

#

i mainly wrote my code like this if () { } else { } etc

#

but someone told me not to

#

is it better ?

ivory sleet
#

For your level it doesn’t matter

trail oriole
#

oh xD

ivory sleet
#

But generally we should avoid if else as they do more than one thing

trail oriole
#

but "get used to it for when you're more advanced"

#

huh ?

#

try catch instead ?

ivory sleet
#

No it’s not about advanced

#

It’s just that when you learn the very language it’s best if you don’t care about what’s the most optimized solution

#

Just learn the tools the language gives you

#

after that you can start looking into speed optimizations, memory optimizations, code readability and so on

trail oriole
#

okok

#

and

#

hum 😅

ivory sleet
#

But ofc if you know that one solution is worse than another you shouldn’t choose the worse one

#

When I said formatting

trail oriole
#

"Extract the variable to outside the method
Specifically inv" how do i do that ? 😅

ivory sleet
#

I didn’t mean what control structures you’re using (if else, try catch, switch etc)

trail oriole
#

ohhhh

#

ok

ivory sleet
#

Look into that

#

It goes over variable scoping

#

Once you’ve understood that then we’ll continue

trail oriole
#

ok

#

ok i got it working a tiny bit more

#

now it resets on server shut down/restart/reload

#

which is not what i'm looking for

#

but it's an advancement

#

even in the main onEnable()

#

what do i do 😦

young knoll
#

You need to write data to a file or database to have things persist

trail oriole
#

mySQL ?

#

or something easier ?

#

i'll google it

worldly ingot
#

You've got options and it depends on what you're storing

#

Could be a simple text file, could be a JSON file, could be a binary file, could be a database, whatever

#

As long as it's written to disk somewhere

#

Some are just more practical than others

trail oriole
#

i need to store an inv

#

is that even possible ?

worldly ingot
#

ItemStack itself is already serializable by Bukkit, so yes absolutely

trail oriole
#
String name = p.getName();

                        ItemStack playerHead = new ItemStack(Material.PLAYER_HEAD);
                        SkullMeta phMeta = (SkullMeta) playerHead.getItemMeta();

                        phMeta.setOwner(name);
                        phMeta.setDisplayName(ChatColor.GOLD + name);
                        playerHead.setItemMeta(phMeta);

                        inv.addItem(playerHead);```
#

public Inventory inv = Bukkit.createInventory(null, 54, "§6Bingo Book");

#

any ideas on how i can store this (and more in the future)

#

google says through the config file

main matrix
#

What are you tryna do

trail oriole
#

i sent the entire code higher

#

a command that puts player's head of specific players in an inv

#

and keep this inventory running forever

#

like even with server restarts

#

Am i being annoying ?

#

i should probably work all this on my own

proud basin
#

nah, just wait till someone knows the answer

solid cargo
#

how can i make it so that i can apply my Unsafe enchant books while also being able to combine safe books

#

cause i have something that copies enchants

#

but i need something that adds enchants

young knoll
#

Check if it's an unsafe book before you do the copying

#

Otherwise let the game handle it

solid cargo
#

but like

#

how

#

i cant figure out the line of code

young knoll
#

You can get the enchantment and its level, yes?

solid cargo
#

bookmeta.getStoredEnchants(Enchants, level) doesnt work ._.

solid cargo
#

ah

misty current
#

ItemStack item = p.getInventory().getItem(e.getHand()); can I shrink this down? (Doing it like that to check for both block placements from offhand and main hand)

quartz panther
#

Can I add icon to existing plugin?

sullen marlin
#

yes, click the edit resource icon link in the sidebar

quartz panther
solid cargo
#

ugh, i cant figure it out

#

i have tried millions of combinations

young knoll
#

Loop through the entry set of that map

#

And check if the value is > the enchants max level

solid cargo
#

yoooooo i fixed it

#

im pro 😎

round elbow
#

ayo why is World.Environment always returning normal even if i run the command while in nether/end

  public String getEnvironmentName(World.Environment e) {
        if (e == World.Environment.NORMAL) {
            return "Overworld";
        } else if (e == World.Environment.NETHER) {
            return "Nether";
        } else if (e == World.Environment.THE_END) {
            return "End";
        } else if (e == World.Environment.CUSTOM) {
            return e.toString();
        } else {
            return "Unknown";
        }
}
ivory sleet
#

How do u invoke the function

round elbow
#

that code is inside of a commandExecutor class ^^^

#

p is a sender which is a player

#

btw player.getWorld().getEnvironment().toString() gives the same exact result
always NORMAL

raw coral
#

What can i use to host a simple api off of my spigot plugin

quaint mantle
#

github to host the code, jitpack for dependencies

paper viper
#

Do you mean like the server running the plugin actually hosts a JSON request API?

#

Idk what you mean by simple api lol

raw coral
quaint mantle
#

use spring

raw coral
#

Can you hover over the red line so we can see the error

#

But if i had to guess its that your second argument is a boolean

#

yeah

#

what are you trying to do

quaint mantle
#

its a boolean

raw coral
#

Thats it?

quaint mantle
#

you're passing a boolean

raw coral
#

like what is that if statement

#

checking

quaint mantle
#

dont do that

raw coral
#

then just do

quaint mantle
#

custom inventory check with a name?

raw coral
#

Well first you should use InventoryHolders

#

to store types of inventories

quaint mantle
#

or a custom inventory holder without api implementation

#
private Inventory inv;

public void createInv() {
    inv = Bukkit.createInventory(/* do whatever */);
}

@EventHandler
public void onInventoryClick(InventoryClickEvent e) {
    if (!inv.equals(e.getInventory()) {
        return;
    }
    // Your code
}
raw coral
quaint mantle
#

no?

#

CraftInventory#equals is overriden

#

well all implementations

#

viewers do not matter

#

bro

#

look up

#

implement that version

#

not titles

raw coral
#

It probably will but its not a good way to do it

raw coral
# quaint mantle use spring

Honestly I've heard of spring but never used it before where would you reccomend me going to to learn about it?

quaint mantle
#

google

unreal quartz
#

it comes before summer

ashen flicker
#

You can handle Gui's by inventory instance

#

you don't have to check by name

muted sand
#

What parts of the api are okay to access while being in an async task?

||trying to get a request from my database, but well, the whole async issue is causing problems||

worldly ingot
#

There's no definitive list, though generally speaking you can fetch something asynchronously then execute anything with the result synchronously

#

Or, rather, on the primary thread

young knoll
#

Hmm, that means I can query nearby blocks async

worldly ingot
#

I mean with a ChunkSnapshot, in theory you could. Not sure why you'd want to though lol

young knoll
#

Looking at nearby blocks for a temperature system

quaint mantle
paper viper
#

When the server shuts down all stuff in memory gets erased

#

That’s why it’s called short term memory sometimes

quaint mantle
#

hmmm then i still want to have a way to prevent that...

icy tiger
#

Hey guys where is a good discord to get a plugin developer

young knoll
#

?services

undone axleBOT
icy tiger
#

Says I need to have at least 20 posts but I rather not spam the forums

quaint mantle
icy tiger
#

Wack

quaint mantle
quaint mantle
#

Should be in #general instead.

icy tiger
#

Oh thanks

muted sand
young knoll
#

Look into futures

muted sand
#

uh

young knoll
#

Or just call a sync task from inside the async one

muted sand
#

oh, alrighty

muted sand
final fog
#

Is there a way where I can rotation something.getLocation().getDirection(); by 45 degrees?

muted sand
#

what would happen if I were to try and access api related things in an async context?
server crashes or something more major?

young knoll
#

Spigot will yell at you

#

And then the code won’t do anything

ancient plank
#

I can crash your server with one line of code

#

player.addPassenger(player);

hasty prawn
#

That crashes the server? KEKW

ancient plank
#

mhm

hasty prawn
#

That's pretty funny

#

Does it work with any entity and itself?

ancient plank
#

should do

#

if you set an entity as its own passenger, it goes 🌬️

young knoll
#

Surprised no one in the line has fixed that

ancient plank
#

I've talked about it a lot

#

oh pog my stash account was made

final fog
ashen flicker
#

Math

final fog
#

anything in specific?

muted sand
ashen flicker
#

Well your dealing with rotation, I dunno man I’m not super math smart, thinking about trying to be though. Probably something to do with sin cos or tangent, maybe sin in your case? I’m not 100% sure

final fog
#

I'm just trying to create a whole new vector

#

If that doesn't go where I want it to go I'll try it your way, ty!

paper viper
young knoll
#

This is why futures are great

paper viper
#

Mhm

young knoll
#

Except people seem to think you are meant to call get on them

muted sand
#

confusing, but i'll go read up on the Future thing, thanks!

round elbow
#
@Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {

        if (!(sender instanceof Player)) return false;

        Player p = (Player) sender;
        Location loc = p.getLocation();
        World.Environment env = p.getWorld().getEnvironment();
        String worldDimension = getEnvironmentName(env);

        Long x = Math.round(loc.getX());
        Long y = Math.round(loc.getY());
        Long z = Math.round(loc.getZ());

        p.chat(x + ", " + y + ", " + z + " @ " + worldDimension);
        return true;
    }

It always returns NORMAL and never returns NETHER or THE_END even if i am in different dimensions

worldly ingot
#

Well what's getEnvironmentName()?

round elbow
#
    public String getEnvironmentName(World.Environment e) {
        if (e == World.Environment.NORMAL) {
            return "Overworld";
        } else if (e == World.Environment.NETHER) {
            return "Nether";
        } else if (e == World.Environment.THE_END) {
            return "End";
        } else if (e == World.Environment.CUSTOM) {
            return e.toString();
        } else {
            return "Unknown";
        }
    }
#

there

quaint mantle
#

welp

round elbow
#

so somehow in both cases it returns NORMAL

quaint mantle
#

so what are you trying to do

round elbow
#

get the environment name
in any dimension
it just doesn't work properly somehow

#

in overworld it returns normal
nether? normal
end? also normal

quaint mantle
#

you dont need to use only 1 code

young knoll
#

That’s, strange

quaint mantle
young knoll
#

Is your spigot up to date

#

That’s paper

round elbow
quaint mantle
young knoll
#

Not sure what you hope to find with the javadocs