#help-archived

1 messages · Page 74 of 1

wise dock
#

pex ❤️

#

i used that thing for sooo long

naive goblet
#

QBINyt switch to LP, if you're using the official version of Pex please switch to LP.

old elk
#

Ok

naive goblet
#

It's outdated and shouldn't be used as the download was removed as well iirc.

remote socket
#

New Team didn't fix t

sudden parrot
#

how to add money to account

naive goblet
#

Idk ask your parents?

old elk
#

Bis there a way to sync ranks with LP through linked bungee servers?

sudden parrot
#

i have the money

naive goblet
#

Yes

sudden parrot
#

it doesn't let me buy

#

i click on the buy now

naive goblet
#

Using MySQL should sync it

sudden parrot
#

doesn't show buy boutton

old elk
#

Ok thanks

naive goblet
#

Else you need to type a cmd for it to sync

#

If you use local stuff or other storages iirc

remote socket
#
            ScoreboardManager manager = Bukkit.getScoreboardManager();
            Scoreboard scoreboard = manager.getNewScoreboard();

            Objective objective = scoreboard.registerNewObjective("Dummy", "");
            objective.setDisplaySlot(DisplaySlot.SIDEBAR);

            //set the title
            String title = ChatColor.translateAlternateColorCodes('&', PlaceholderAPI.setPlaceholders(player, plugin.getConfig().getString("title")));
            objective.setDisplayName(title); //title name

            List<String> lines = plugin.getConfig().getStringList("lines");
            int counter = lines.size();
            for (String line : lines) {

                Team team = scoreboard.registerNewTeam(line);

                plugin.logger.info("Counter: " + counter);
                String part1 = "";
                String part2 = "";
                String part3 = "";
                int length = line.length();
                if (length <= 16) {
                    part1 = line;
                } else if (length <= 32) {
                    part1 = line.substring(0, 15);
                    part2 = line.substring(16);
                } else {
                    part1 = line.substring(0, 15);
                    part2 = line.substring(16, 31);
                    part3 = line.substring(32);
                }

                plugin.logger.info("Part1: " + part1);
                plugin.logger.info("Part2: " + part2);
                plugin.logger.info("Part3: " + part3);

                team.setPrefix(part1); //prefix
                team.addEntry(part2); //middle part
                objective.getScore(part2).setScore(counter); //middle part
                team.setSuffix(part3); //suffix
                counter--;
            }

            player.setScoreboard(scoreboard);
#
title: "Test Title"
lines:
- "line1"
- "line2"
- "line3"
#

my config^

oak stump
#

I want you to read it carefully and either ask or Google anything you don't know
@wise dock thanks mate, ima read and do it now,i owe u one, (sorry i didnt reply my computer crashed 4 some reason ):)

fair abyss
#

is "counter" constant?

torn robin
#

counter--;

remote socket
#

No

#

[17:56:56 INFO]: [Board] Counter: 3
[17:56:56 INFO]: [Board] Part1: line1
[17:56:56 INFO]: [Board] Part2:
[17:56:56 INFO]: [Board] Part3:
[17:56:56 INFO]: [Board] Counter: 2
[17:56:56 INFO]: [Board] Part1: line2
[17:56:56 INFO]: [Board] Part2:
[17:56:56 INFO]: [Board] Part3:
[17:56:56 INFO]: [Board] Counter: 1
[17:56:56 INFO]: [Board] Part1: line3
[17:56:56 INFO]: [Board] Part2:
[17:56:56 INFO]: [Board] Part3:

#

The output it also correct

fair abyss
#

dont know scorepoard api very much, never used. I suggest you to no use

remote socket
#

Is it because the prefix and suffix are the same value

#

dont know scorepoard api very much, never used. I suggest you to no use
Then how am i supposed to make a scoreboard lol

fair abyss
#

theres api / library things in google/github

#

just use them

#

or make papi support

#

and use one of spigot scoreboard plugin

remote socket
#

I figured it out

#

It's because if the length is less than 16 it uses suffix

#

But that makes the main part = ""

#

and its duplicate

#

So it doesnt show

fair abyss
#

are you trying to make sb plugin?

#

or show your values at sidebar?

#

afk for a while

remote socket
#

Scoreboard

#

yep it works

#
                if (length <= 16) {
                    //set part 2 or it will be duplicate
                    part2 = line;
                }
#

That was the issue

frigid ember
#
    @EventHandler
    public void onInteract(PlayerInteractEvent e) {
    Player p = e.getPlayer();

    ItemStack i = p.getItemInHand();

    MapView mv = Bukkit.getServer().getMap(i.getDurability());
    
    if (mv == null) {
        p.sendMessage("map not found");
    }
    
    mv.setCenterX(p.getLocation().getBlockX());
    mv.setCenterZ(p.getLocation().getBlockZ());
    Scale s = mv.getScale();
    
    Action ac = e.getAction();
    
    if (ac == Action.RIGHT_CLICK_AIR) {
        mv.setScale(Scale.FARTHEST);
    }
    
    if (ac == Action.LEFT_CLICK_AIR) {
        mv.setScale(Scale.CLOSEST);
    }
    
    p.sendMessage(mv.getScale().toString());
    }

Its not zooming in, but Im getting sent the messages

naive goblet
#

You checked so it's not locked

#

or mb it doesnt makes sense

frigid ember
upper hearth
#

Try MapMeta#setMapView

frigid ember
#

@upper hearth I'm in 1.8 I can't find that method

upper hearth
#

Use MapMeta#setScaling then

#

well

#

nvm

lusty vortex
#

Eh I messed with trying to make a custom map. It doesn't go over 128x128 no matter the scale

frigid ember
#

I'm trying to get it i to zoom

oak stump
#

hey @wise dock this shoudl work right????
I read through ur initial example and this is what i have ended up with:

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onInvClick(InventoryClickEvent e) {
        Player p = (Player) e.getWhoClicked();
        this.checkInventoryNextTick(p);
    }

    private void checkInventoryNextTick(final Player p) {
        Bukkit.getScheduler().runTaskLater(plugin, new Runnable() {
            @Override
            public void run() {
                
                final ItemStack helmet = p.getInventory().getHelmet();      
                final ItemStack chestplate = p.getInventory().getChestplate();
                final ItemStack leggings = p.getInventory().getLeggings();
                final ItemStack boots = p.getInventory().getBoots();
                
                if ((helmet != null) && (helmet.getType() == Material.LEATHER_HELMET)) {
                    if (helmet.getItemMeta().getDisplayName() != null) {
                        if (p.getInventory().getHelmet().getItemMeta().getDisplayName().equalsIgnoreCase("§0Assassin Hood")) {
                            p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 1, true, false));```
#

the whole thing wouldnt fit

#

so i just put the first if statement

wise dock
#

try it and see if it works 🙂

oak stump
#

thx alot

wise dock
#

also you don't need this.checkInventory...

#

this. has it's place, abusing it is not good form

bronze marten
#

or final

wise dock
#

i am prone to abusing final, more often than not that's a good thing

oak stump
#

so i can get rid of the ```this.checkInventoryNextTick(p);
}

private void checkInventoryNextTick(final Player p) {```
bronze marten
#

idk i find the excessive use of final annoying

wise dock
#

rule of thumb is if you think something shouldn't change value then slap a final there. if your code has errors then you know your assumption is wrong 🙂

#

also you're helping JIT, even though lately it's pretty smart to figure it out eventually

bronze marten
#

modern JVM's figure that out by themselves.

wise dock
#

yep they do

bronze marten
#

plus idk, the final word is just too long

oak stump
#

here goes first test

bronze marten
#

const vs let in javascript is nice

oak stump
#

OMG IT DIDNT WORK

bronze marten
#

but writing 6 chars in front of every declr

#

and keeping a 120 char limit

#

idk

frigid ember
#

This is unnessecary

    public void onInteract(final PlayerInteractEvent e) {
    final Player p = e.getPlayer();

    final ItemStack i = p.getItemInHand();
wise dock
#

yes, i can certainly see where you're coming from

bronze marten
#

for class vars im def. in to use final tho

oak stump
bronze marten
#

for class vars wherever possible, but inside methods im much more relaxed for it

#

though for anonymous classes / lambda its required

wise dock
#

umm @oak stump slap a this.plugin = plugin somewhere in your constructor

bronze marten
#

so occasionally doing it there if the compiler cant figure out its already effecively final

oak stump
#

oh lol

#

thought it was still ther

#

test 2

#

nope

#

nothing happens at all

#

no errors

#

no effects

#

nothing

#

):

wise dock
#

last thing you should check is the armor meta actually has the strings you're checking for

idle zodiac
#

real problem starts at 847

wise dock
#

one easy way is to replace equalsIgnoreCase with contains("Assassin") and visually make sure it has that word in

oak stump
#

if (helmet.getItemMeta().getDisplayName() != null) { do i need this

wise dock
#

you can optimize a lot of things, but that comes later. first make it run 🙂

tiny dagger
#

no

#

it doesn't come later

#

later you have other scopes to take care

wise dock
#

“Premature optimization is the root of all evil” @ Donald Knuth

tiny dagger
#

🤔

wise dock
#

That doesn't mean to write sloppy code

torn robin
#

wait

#

why are you

#

creating a new world

#

what

idle zodiac
#

me?

#

I'm making skybloick

torn robin
#

yes

idle zodiac
#

and I wanna create a new world

wise dock
#

But in this particular case we're going for seeing something work, get some adrenaline from that, and then come back to make it better as a learning experience

torn robin
#

i don't think that's how you wanna do it

#

you'd want to use a custom generator for the world

idle zodiac
#

ik

torn robin
#

i think at least

idle zodiac
#

i justr need to build a chest

#

with items

#

and its not working

fair abyss
#

want to put items to chest right? @idle zodiac

idle zodiac
#

@fair abyss ye

fair abyss
#

chest has a block inventory

#

get and put items on it

idle zodiac
#

ik

#

butttt

#

its in anoither world

#

so its thowing an NPE

#

what do i do XD

#

The chunk is loaded

#

The world should be loaded

#

but its still throwing an NPE

fair abyss
#

your problem isn't putting items

#

i think you cant get block

idle zodiac
#

ye

#

ik

#

my brain hurts

fair abyss
#

is your location null to?

idle zodiac
#

i've been doing this shite all day

fair abyss
#

check it

idle zodiac
#

uhh

fair abyss
#

-_*

idle zodiac
#

its not saying anything in intellij

#

but let me try

fair abyss
#

and, your world

idle zodiac
#

it works

#

but i cant get at the block

fair abyss
#

run your code later than custom world's init

#

basicly listen it's event (if theres)

idle zodiac
#

ok so my location is null

fair abyss
#

or run your code 1-2 tick (maybe sec )later

idle zodiac
#

aah

fair abyss
#

just on enable() { new BukkitRunnable() -> code here).runTaskLater(this, 20,20)

#

example

idle zodiac
#

ok...

fair abyss
#

cus some plugin's custom world's which has custom generator they can be null when onenable

idle zodiac
#

oo ok

#

so

#

in my main class

#

in onenable

#

i make a new bukkitrunnaebleb

#

anad do smth with it

#

i'm so confused

naive goblet
#

why BukkitRunnable

idle zodiac
#

i haven't a clue

#

i dont do spigot XD

naive goblet
#

lol ok

idle zodiac
#

i've just started doing this

naive goblet
#

keep going then ima go

idle zodiac
#

i have a good knowledge of java but spigot is new to me

naive goblet
#

It's not the hardest :]

idle zodiac
#

it is for a complete noob

#

lol

fair abyss
#

why BukkitRunnable
@naive goblet

#

cus some plugin's custom world's which has custom generator they can be null when onenable

idle zodiac
#

i'm using VoidGenerator

#

because its cool

naive goblet
#

Consumer<BukkitTask>

idle zodiac
#

tf

naive goblet
#

and Runnable

idle zodiac
#

i'm so lost XD

naive goblet
#

It was answer to kingOf0

idle zodiac
#

o ok

fair abyss
#

just on enable() { new BukkitRunnable() -> code here).runTaskLater(this, 20,20)
you now right? this code wont work if you copy paste

#

just example

idle zodiac
#

ik

#

i'm not that dumdum

fair abyss
#

use runnable how you want idc

oak stump
#

@wise dock i still cant get it to work

idle zodiac
#

aha

oak stump
#

ive debugged it to the end of its life

idle zodiac
#

i kind of know what to do now

fair abyss
#

whats null

#

world?

naive goblet
#

Runnable accepts lambdas but cant be cancelled

harsh crescent
#

I almost use bukkitrunnable unless i have multithreading operations i need to do onDisable, which in that case I just open a new thread

oak stump
#

for @wise dock , this is my code, doesnt wanna work and i have tried everything, if it is not this then i get errors

naive goblet
#

I mean BukkitRunnable still exist because many plugins still use it

#

BukkitTask can replace it entirely I'd say

oak stump
#

for @wise dock , this is my code, doesnt wanna work and i have tried everything, if it is not this then i get errors
does anyone know how to fix this?

fair abyss
#

why "checkInventoryNextTick" @oak stump

oak stump
#

thats what came recommended, at first i didnt have a very good thing and then they intereduced ticks and stuff and it still doesnt work.

#

ignore my spelling

fair abyss
#

really, who suggest this and why

idle zodiac
#

So I've made a BukkitRunnable to delay the chest generator 2 ticks, do you think this will work?

fair abyss
#

probably

#

is it ASkyBlock world?

idle zodiac
#

no

#

i'm making my own thing

fair abyss
#

or another world like that?

idle zodiac
#

ye

fair abyss
#

so try and see

idle zodiac
#

its a new world for the island

oak stump
#

any way of fixing it @fair abyss

fair abyss
#

@oak stump what you want?

#

just checking player's helmet?

oak stump
#

basically, when a player equips a helmet called §0Assassin Hood i want it to give the player night vision

fair abyss
#

"equiping armor"

#

isn't about just this event

idle zodiac
#

now its jsut not working at al

fair abyss
#

theres api for this event use them @oak stump

naive goblet
#

§0 ?

final verge
#

event isn't in spigot yet

#

still is a PR

fair abyss
#

i didnt say spigot has api for this.

final verge
#

there are libraries out there that serve as a subsitute

#

oh

#

well it will soon

fair abyss
#

theres public api for this

#

on github etc

idle zodiac
fair abyss
#

"Plugin already initialized!"

#

have you more than one Plugin instance?

final verge
#

This hopefully should get into 1.16 and we finally will have an actual event for it

idle zodiac
#

@fair abyss my brain idk

fair abyss
#

This hopefully should get into 1.16 and we finally will have an actual event for it
@final verge yes it will better for enchant plgs

final verge
#

also that one work's for mobs

fair abyss
#

great

final verge
#

like if a mob spawns in with armour, the event gets fired too

idle zodiac
#

I just want to generate a chest XD

fair abyss
#

😛

idle zodiac
#

i tried executing a cmd on an endermite

fair abyss
#

@idle zodiac can you send full code

idle zodiac
#

but it didnt work that well

#

sure

fair abyss
#

Main main = new Main();

#

this is the problem

idle zodiac
#

literally

fair abyss
#

remove it

idle zodiac
#

idk what i'm doing

#

how do i do the task then

fair abyss
#

get class's instance

#

and learn java

idle zodiac
#

I know class

#

but my brain hurts now

#

fuck

#

java

naive goblet
#
class Main extends JavaPlugin {
  @Override public void onEnable() {
    Bukkit.getScheduler().runTaskTimer(this, ()-> {

    }, 20L, 20L);
  }
}```
fair abyss
#

?

worldly heathBOT
#

Edit this to change the output of the command!

naive goblet
#

We don't create a new instance of main in spigot api

idle zodiac
#

my brain

naive goblet
#

we just register everything in onEnable

#

?

worldly heathBOT
#

Edit this to change the output of the command!

naive goblet
#

Much stuff about your brain now

idle zodiac
#

so

fair abyss
#

@idle zodiac whats about organizing your class first?

#

maybe create a class for your world

idle zodiac
#

@fair abyss ?

#

my brain hurts

#

so

#

I just want to run a piece of code a few ticks later than the rest

novel phoenix
#

your brain hurts because you have no idea what your code is doing

fair abyss
#

move your new World()... to a class

novel phoenix
#

you're just juggling random objects around

idle zodiac
#

I just started with spigot ok

#

I know java

fair abyss
#

and java too

idle zodiac
#

but I dont know spigot

fair abyss
#

dont think so

idle zodiac
#

I'm not great

#

but I have an understanding

#

of some sorts

fair abyss
#

you have problem with basics

idle zodiac
#

XDD

novel phoenix
#

I can't even understand what are you trying to achieve with code you linked above

fair abyss
#

put items on chest xD

subtle blade
#

No. Do not create any new instances of 99.9% of interfaces within Bukkit

#

World is not an interface to be created

#

You retrieve it from other sources from the API

idle zodiac
#

literally

subtle blade
#

Whether that be events, entities, locations, whatever

idle zodiac
#

if my code is clunky and horrible

#

it doesnt matter

novel phoenix
#

bukkit has events for World initialization and loading

idle zodiac
#

as long as it works XD

novel phoenix
#

you should use these

subtle blade
#

No, what I'm saying is your code will not work

#

At all

novel phoenix
#

to manipulate fresh worlds

subtle blade
#

You cannot create a new World()

novel phoenix
#

instead of trying to schedule it

fair abyss
#

just want to be "innocent" no body telled him say create new World()

idle zodiac
#

Look

novel phoenix
#

also World is just bukkit interface for CraftWorld which is wrapper for nms world object

#

as Choco said

idle zodiac
#

i'm just trying to create a chest with items

#

thats all

novel phoenix
#

creating new anonymous instance of it

#

won't do anything

idle zodiac
#

the rest is fine

fair abyss
#

cohoco says use Bukkit's mtehod to create a world

wise dock
#

@oak stump one thing i noticed you're checking for "cloak" meta for both chest and leggings.

fair abyss
#

Bukkit.createWorld
there should be method like this

idle zodiac
#

I've been using WorldCreator

#

Do you think thats it?

novel phoenix
#

also if you're creating some kind of skyblock plugin

#

creating a world per player is bad idea performance wise

fair abyss
#

dont do this

idle zodiac
#

@novel phoenix It's ok for now as its only going to be small. I can edit it later

fair abyss
#

what

#

are you crating world per player.

#

...

pure canopy
#

Does anyone know how to pull the colon to the command chest eg.
ID: 160:8

idle zodiac
#

i'm not gpiong to have thousands of players ok

naive goblet
#

@pure canopy yeah

idle zodiac
#

i'm just trying to have a nice little sb plugin

#

I can edit it later

naive goblet
#

edit durability

idle zodiac
#

I just want chest generation

naive goblet
#

I believe thats how you do it in older vers

pure canopy
#

@ Conclure # 1262 help me by DM

naive goblet
#

taking it as you're doing it in 1.8.8 or below

pure canopy
#

?

naive goblet
#

uhm

subtle blade
#

👏 You 👏 can 👏 not 👏 instantiate 👏 a 👏 World 👏 instance 👏

naive goblet
#

here the channel to get help

idle zodiac
#

OK

#

So

worldly heathBOT
#

Edit this to change the output of the command!

idle zodiac
#

I removed my world instantiation

naive goblet
#

@idle zodiac You have done much right but the difference here is that creating a new World like that is not the way to go. It probably exist a method to create a new World. It's rare to create new instances except from items

idle zodiac
#

now what

pure canopy
#

so how would you add it here to pull the 2 points in an id
||cristal1:
COMMAND: ''
NAME: ''
LORE:
ID: 160:8
POSITION-X: 1
POSITION-Y: 1||

fair abyss
#
    Bukkit.createWorld(#WorldCreator)
idle zodiac
#

AAAAAh

#

o

#

ok

#

got it

#

kind of

#

so

naive goblet
#

Because most things alr exist on the server so we just have to get the right instances

fair abyss
#

maybe Bukkit.createWorld(new WorldCreator("idk"))

idle zodiac
#

I have my worldcreateor

#

ok

#

so

naive goblet
#

You could create a reference to the wc

#

and then

idle zodiac
#

I've done that

naive goblet
#

edit it

idle zodiac
#

now the trouble is pasting my schem

#

because it wants a worldedit world object

#

I cant cast a bukkit world to a we world

naive goblet
#

@pure canopy

idle zodiac
#

how can i paste my schem without doing that

dusty topaz
#

Any recommendations for a paginated gui api? Need to make a quick one and don't feel like making my own for it

naive goblet
#

Matt

#

He has a good framework I believe

idle zodiac
#

also thanks for just dividing my line count by 100 XDDDD

fair abyss
#

I just want chest generation
@idle zodiac

        Chest block = (Chest) location.getBlock();
        block.getBlockInventory().addItem(new ItemStack(Material.STICK));
idle zodiac
#

@fair abyss Cool thanks

#

now i just need to paste my schem

#

and i'm game

dusty topaz
#

I cant cast a bukkit world to a we world

#

Use their adapter

#

BukkitAdapter iirc

idle zodiac
#

?

worldly heathBOT
#

Edit this to change the output of the command!

idle zodiac
#

Haven't herad of that

naive goblet
#

@pure canopy Split the :

idle zodiac
#

how do i use it

dusty topaz
#

why don't you type it and see what your IDE gives you

#

or look at docs

idle zodiac
#

ok

#

AHA

#

com.sk89q.worldedit.world.World world = new BukkitWorld(world1);

#

is this legal

fair abyss
#

dont think so..

idle zodiac
#

my bukkit world is world1

#

my we world is world

#

its backward

fair abyss
#

Use their adapter

#

he said

idle zodiac
#

ok...

devout mirage
#

getting the different between two times?

fair abyss
#

@devout mirage just - them

idle zodiac
#

thanks

devout mirage
#

i need to save a time when a player does a command

naive goblet
#

¨Map

fair abyss
#

time is long in ms
just - them

devout mirage
#

and then when i run a special command i want to see how long its been since the player ran the command

#

in seconds

naive goblet
#

Use a Map<Player, Long>

novel phoenix
#

Math.abs(time1 - time2)

#

lol

devout mirage
#

examples please

#

mind you i need this to work across servers

#

some server may be in italy other in france

fair abyss
#
        long time2 = idk;
        long difInSeconds = (time - time2) / 1000;
devout mirage
#

so i need same time zone for both

subtle blade
#

Wait why is it you're creating a world?

naive goblet
#

Veron I think you should learn some data structures 😄

subtle blade
#

Aren't you trying to set a chest in an existing world?

novel phoenix
#

UNIX time doesn't have timezones

dusty topaz
#

he's trying to paste a schematic

devout mirage
#

whats a unix time?

dusty topaz
#

and didn't listen to me telling him to use an adapter

#

😠

subtle blade
#

Yea so... why Bukkit.createWorld()?

fair abyss
#

he wanted to get we instance, then he "new ..." :D

Wait why is it you're creating a world?
@subtle blade

subtle blade
#

Yea but createWorld() will generate a new world

#

That's not what you want

dusty topaz
#

yeah he knows now

subtle blade
#

Okay

novel phoenix
#

@devout mirage can you show us examples of your own code before asking for examples

dusty topaz
#

he was trying to get the world edit World

subtle blade
#

Missed a bit of conversation. Was outside playing with the dogs lol

idle zodiac
#

ok so the BukkitAdapter can't be found

#

gg

dusty topaz
#

ok, time to quit

#

👍

idle zodiac
#

XDD

#

cya

dusty topaz
#

(joking, just sort out your dependencies)

idle zodiac
#

ok

#

So

#

I have FAWE at the top

#

then WE

#

then spigot

#

is that correct XD

fair abyss
#

?

pure canopy
#

@naive goblet I have to modify there

cristal1: COMMAND: '' NAME: '' LORE: ID: 160:8 POSITION-X: 1 POSITION-Y: 1

naive goblet
#

codewise?

#

or

#

wha

fair abyss
#

chestcommands??

worldly heathBOT
#

Edit this to change the output of the command!

pure canopy
#

Yes

#

to pull the 2 points

naive goblet
#

regexz

fair abyss
#

points?

naive goblet
#

mb

#

pull 160 from 8

#

ig

pure canopy
#

ID: 160:8

#

reloading the plugin gives me an error

fair abyss
#

so paste it

worldly heathBOT
pure canopy
idle zodiac
#

Can i use BukkitImplAdapter for what i'm trying to do?

devout mirage
#
public class Invite {
    
    int pastTime = null;
    
    public void setTime() {
        pastTime = //get current time here converted to seconds
    }
    
    public int getTimeDifference() {
        int currentTime = //get current time here converted to seconds
            return currentTime - pastTime;    //returns seconds passed between both times
    }

}
#

@novel phoenix

novel phoenix
#

you get current time in millis by doing System.currentTimeMillis()

fair abyss
#

/ 1000 for get secondd

novel phoenix
#

then you can convert it with TimeUnit.MILLISECONDS.toSeconds(value)

fair abyss
#

1000ms = 1 sec

naive goblet
#

^

#

TimeUnit is really nice

fair abyss
#

you can use TimeUnit too

#

thats the class which i forget exist xD

devout mirage
#

so if i set time on one server in france and get the time difference on another server in italy the time difference will be accurate?

novel phoenix
#

do you have ntp set up on both servers?

devout mirage
#

no

novel phoenix
#

do it

devout mirage
#

i need to get the time of a specific state

#

and use that states time for both servers

#

how do i do that

novel phoenix
#

System.currentTimeMillis() returns UNIX time

#

it doesn't have timezones on top of it

#

if you synchronize time on both servers using ntp

devout mirage
#

i need the time from the state california

#

not from unix

novel phoenix
#

bruh

fair abyss
#

unix isnt a country...

novel phoenix
#

thats the most american thing I've read today

devout mirage
#

well i need to know how to get the time in california

novel phoenix
#

well google how to get time in specific timezone then?

devout mirage
#

couldnt find out how

fair abyss
#

whats the timezone between that counrty?

#

how much hour?

idle zodiac
#

Apparently BukkitAdapter is not visible...

#

Can I use BukkitImplAdapter XD

devout mirage
#
Calendar calendar = new GregorianCalendar();   
        TimeZone tz = TimeZone.getTimeZone("America/New_York");
        calendar.setTimeZone(tz);
        int hour = calendar.get( Calendar.HOUR );  ```
#

how do i use get this time in seconds?

fair abyss
#

int hour = calendar.get( Calendar.HOUR );

#

really?

#

just change hour to seconds

pure canopy
devout mirage
#

ok so now regardless of where the server is hosted it will give me the NY time in seconds?

pure canopy
#

that I have to modify so that it pulls the id

novel phoenix
#

@idle zodiac I think you're supposed to get BukkitAdapter object using the WE plugin instance

devout mirage
#
Calendar calendar = new GregorianCalendar();   
        TimeZone tz = TimeZone.getTimeZone("America/New_York");
        calendar.setTimeZone(tz);
        int second = calendar.get( Calendar.SECOND);   ```
novel phoenix
#

which you can get using the bukkit PluginManager

idle zodiac
#

?

worldly heathBOT
#

Edit this to change the output of the command!

novel phoenix
#

something like getServer().getPluginManager().getPlugin("WorldEdit")

idle zodiac
#

O OK

novel phoenix
#

I might get the syntax wrong

fair abyss
#

that calender may not work

#

let me try

frigid ember
#

am i able to use essentialsx to give someone a golden shovel on join with the one time kit?

devout mirage
#
public class Test {

    int pastTime = 0;

    public void setTime() {
        pastTime = getTime();
    }

    public int getTimeDifference() {
        int currentTime = getTime();
        return currentTime - pastTime;
    }

    public int getTime() {
        Calendar calendar = new GregorianCalendar();   
        TimeZone tz = TimeZone.getTimeZone("America/New_York");
        calendar.setTimeZone(tz);
        int second = calendar.get( Calendar.SECOND);   
        return second;
    }
    
    public boolean minutePassed() {
        return getTimeDifference() >= 61;
    }

}
#

@fair abyss @novel phoenix

#

good?

idle zodiac
#

@novel phoenix not woroking XD

fair abyss
#

yes wont work

#

"second"

#

is same

#

everywhere

#

in world

#

"hour" is different

#

@devout mirage

devout mirage
#

no its not

fair abyss
#
        TimeZone tz = TimeZone.getTimeZone("America/New_York");
        calendar.setTimeZone(tz);
        int second = calendar.get( Calendar.SECOND);
        System.out.println("s: " + second);

        Calendar calendar2 = new GregorianCalendar();
        TimeZone tz2 = TimeZone.getTimeZone("Asia/Istanbul");
        calendar2.setTimeZone(tz2);
        int second2 = calendar2.get( Calendar.SECOND);
        System.out.println("s2: " + second2);```
karmic socket
#

Hi. Do anyone know why i my scoreboard flash when tablist updated? (downloaded tablist and scoreboard)

fair abyss
devout mirage
#

how can it be the same???

fair abyss
#

second is same everywhere...

novel phoenix
#

@idle zodiac can't help you with implementation specifics

devout mirage
#

how can 5am be the same as 6pm in seconds?

novel phoenix
#

cuz I haven't worked with it for years

fair abyss
#

actually minute will be same too

#

an example:
where do you live

#

what'o clock?

novel phoenix
#

bruh

#

maybe because

#

seconds are ranged from 0 to 59

devout mirage
#

its common sense

novel phoenix
#

so they will be the same across everytimezone?

fair abyss
#

@novel phoenix yes

devout mirage
#

told you its not the same

#

!= 9

fair abyss
#

its HOUR

#

not SECOND

#

i said SECOND is same.

devout mirage
#

ok try that with other time zones

novel phoenix
#

this conversation is giving me vibes

devout mirage
#

like 5 others and lets see if theyre the same

fair abyss
#

dude

novel phoenix
#

@devout mirage do you even know what you are trying to achieve?

#

like

fair abyss
#

everyone's time is xx:22 now

novel phoenix
#

what the final result should be

fair abyss
#

everyone's time is xx:23 now

novel phoenix
#

23:23 can confirm

#

lol

fair abyss
#

minute and second is same

#

HOUR

#

is different

#

its 21:23 here

karmic socket
#

20:23

#

😄

fair abyss
#

see huh?

#

@devout mirage

devout mirage
#

so how the fuck

fair abyss
#

i think your idea is wrong

devout mirage
#

can i tell if 5 minutes passed

fair abyss
#

just re think what you want to do

devout mirage
#
public class Test {

    int pastTime = 0;

    public void setTime() {
        pastTime = getTime();
    }

    public int getTimeDifference() {
        int currentTime = getTime();
        return currentTime - pastTime;
    }

    public int getTime() {
        Calendar calendar = new GregorianCalendar();   
        TimeZone tz = TimeZone.getTimeZone("America/New_York");
        calendar.setTimeZone(tz);
        int second = calendar.get( Calendar.SECOND);   
        return second;
    }
    
    public boolean minutePassed() {
        return getTimeDifference() >= 61;
    }

}```
novel phoenix
#

bruh

#

just use

#

System.currentTimeMillis()

#

?

fair abyss
#

comparing SECOND wont help you
or MINUTE

worldly heathBOT
#

Edit this to change the output of the command!

devout mirage
#

i know it wont fucking help

fair abyss
#

get time in milis

#

and compare

#

like how us said

devout mirage
#

thats why i said i need to compare the time with the same time zone

novel phoenix
#

why are you so adamant

frigid ember
#

-_-

novel phoenix
#

about timezones

fair abyss
#

System.out.println("c: " + (calendar.getTimeInMillis() - calendar2.getTimeInMillis());

novel phoenix
#

have a read please

#

because you don't understand how computer time works

devout mirage
#

tell me how to do it with this code to see if 5 minutes have passed

#
public class Test {

    int pastTime = 0;

    public void setTime() {
        pastTime = getTime();
    }

    public int getTimeDifference() {
        int currentTime = getTime();
        return currentTime - pastTime;
    }

    public int getTime() {
        Calendar calendar = new GregorianCalendar();   
        TimeZone tz = TimeZone.getTimeZone("America/New_York");
        calendar.setTimeZone(tz);
        int second = calendar.get( Calendar.SECOND);   
        return second;
    }
    
    public boolean minutePassed() {
        return getTimeDifference() >= 61;
    }

}```
fair abyss
#

just dont paste your code

#

i mean dont spam

devout mirage
#

then paste this code edited

#

using the newyork time zone

novel phoenix
#

can you explain

#

what do you need timezones for?

#

like, I'm really interested now

fair abyss
#

i already said

devout mirage
#

how do i tell if 5 minutes have passed with my code above

fair abyss
#

compare time in milis

devout mirage
#

HOW

fair abyss
#

and check dif >5 min

#

🤦‍♂️

frigid ember
#

lel

#

can someone help me lol

devout mirage
#

wait

#

for me to get help first

novel phoenix
#

@frigid ember whats your problem

clever hornet
#

is there anybody here who knows html for buycraft and can tell me how to fix this error

naive goblet
#

?ask @frigid ember

#

why bot no work

frigid ember
#

am i able to use essentialsx to give someone a golden shovel on join with the one time kit?

naive goblet
#

?ask

#

Yes

devout mirage
#

i just told you to wait

worldly heathBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

naive goblet
#

uhm

novel phoenix
#

bot having a seizure

frigid ember
#

yes

devout mirage
#

@fair abyss you still didnt explain how

fair abyss
#

said like 5 minute ago

frigid ember
#

yes he did

devout mirage
#

you didnt say how i do it

#

you didnt provide any code

fair abyss
#

i wont going to give full code

#

no body will

devout mirage
#

its just editing my code

frigid ember
#

@subtle blade can you warn this kid

fair abyss
#

^^

devout mirage
#

dont offer help if you arent going to actualy help

frigid ember
#

-_-

fair abyss
#

already helped...

devout mirage
#

if you did i wouldnt be here still

frigid ember
#

read the fucking chat dude

naive goblet
#

Veron get the millis turn it to minutes and compare?

devout mirage
#

ok but how

#

didnt explain HOW

naive goblet
#

whats ur code?

#

Resend here

devout mirage
#
public class Test {

    int pastTime = 0;

    public void setTime() {
        pastTime = getTime();
    }

    public int getTimeDifference() {
        int currentTime = getTime();
        return currentTime - pastTime;
    }

    public int getTime() {
        Calendar calendar = new GregorianCalendar();   
        TimeZone tz = TimeZone.getTimeZone("America/New_York");
        calendar.setTimeZone(tz);
        int second = calendar.get( Calendar.SECOND);   
        return second;
    }
    
    public boolean threeMinutePassed() {
        return getTimeDifference() >= 183;
    }

}```
naive goblet
#

dont want to reinvestigate in a chaos

fair abyss
#

and got a new idea

#

comparing with milis wont help too

devout mirage
#

stfu

fair abyss
#

cus they are same

devout mirage
#

let Conclure help

fair abyss
#

im not talking to you?

devout mirage
#

youre spamming stop

novel phoenix
#

pity custom discord emojis are behind paywall

fair abyss
#

actually you spammed this code 3 times.

novel phoenix
#

in this server

devout mirage
#

stop talking and let conclure help cause you keep saying you already helped me which atually wasnt help and you refuse to post any code so just sftu

naive goblet
#

okay

#

so

#

do calender.getSeconds(Calender.SECONDS) / 60

#

and we get minutes

#

right?

devout mirage
#

right

fair abyss
#

there should be newbiekit in essentials config (or similar thing)

frigid ember
#

anyone are you able to change the essentalsx first join kit contents?
i deleted it my bad

naive goblet
#

now check if getTimeDifference > 5

#

ig

novel phoenix
#

it won't work tho

#

:D

fair abyss
#

second is same...

#

everywhere

#

note: minute same too

naive goblet
#

Yeah I c

fair abyss
#

just googling it probably help

naive goblet
#

Veron store the times

devout mirage
#

i have it stored in the pastTime var

naive goblet
#

Wait can we use LocalDate?

#

Or would perhaps not get different dates

frigid ember
#

lol

novel phoenix
#

yeah if only there was a method to retrieve

#

current unix time

#

in milliseconds

#

🤔

naive goblet
#
public class TimeIgnoringComparator implements Comparator<Calendar> {
  public int compare(Calendar c1, Calendar c2) {
    if (c1.get(Calendar.YEAR) != c2.get(Calendar.YEAR)) 
        return c1.get(Calendar.YEAR) - c2.get(Calendar.YEAR);
    if (c1.get(Calendar.MONTH) != c2.get(Calendar.MONTH)) 
        return c1.get(Calendar.MONTH) - c2.get(Calendar.MONTH);
    return c1.get(Calendar.DAY_OF_MONTH) - c2.get(Calendar.DAY_OF_MONTH);
  }
}
```Code from stackoverflow [https://stackoverflow.com/questions/1439779/how-to-compare-two-dates-without-the-time-portion]
fair abyss
#

// Convert timestamp to ZonedDateTime in the correct time zone
        ZonedDateTime estTime = ts.toLocalDateTime().atZone(ZoneId.of("America/New_York"));

// Could pass in ZoneId.of("Asia/Kolkata") argument to now(...), but not required
// as "now" is the same instant in all time zones.
        ZonedDateTime zonedNow = ZonedDateTime.now();

// Can use other ChronoUnit values if required.
        long timeDiff = ChronoUnit.MILLIS.between(zonedNow, estTime);
        System.out.println(timeDiff);```
naive goblet
#

You could do something similar to this

novel phoenix
#

pity it doesn't exist

#

java bad

devout mirage
#
public class Test {

    int pastTime = 0;

    public int getTime() {
        Calendar calendar = new GregorianCalendar();   
        TimeZone tz = TimeZone.getTimeZone("America/New_York");
        calendar.setTimeZone(tz);
        int hour = calendar.get( Calendar.HOUR); 
        int second = calendar.get( Calendar.SECOND); 
        return hour+second;
    }
    
    public void setTime() {
        pastTime = getTime();
    }

    public int getTimeDifference() {
        int currentTime = getTime();
        return currentTime - pastTime;
    }
    
    public boolean minutesPassed(int minutes) {
        return getTimeDifference() >= ((60 * minutes)+ 1);
    }

}
```what about this? adding hour and seconds?
#

@naive goblet

fair abyss
#

// Convert timestamp to ZonedDateTime in the correct time zone
        ZonedDateTime estTime = ts.toLocalDateTime().atZone(ZoneId.of("America/New_York"));

// Could pass in ZoneId.of("Asia/Kolkata") argument to now(...), but not required
// as "now" is the same instant in all time zones.
        ZonedDateTime zonedNow = ZonedDateTime.now();

// Can use other ChronoUnit values if required.
        long timeDiff = ChronoUnit.MILLIS.between(zonedNow, estTime);
        System.out.println(timeDiff);```

just use this fucking and go away

devout mirage
#

@fair abyss i dont want your crap help begone

safe thunder
fair abyss
#

the worst people I see ever.

silk cape
#

Who can help me with disabling mob Ai

safe thunder
#

invalid entity ?

devout mirage
#

good so go away

frigid ember
naive goblet
#

veron

novel phoenix
#

@silk cape which version

devout mirage
#

@naive goblet do you see this working?

silk cape
#

1.8

naive goblet
#

make a constructor for test

novel phoenix
#

@silk cape delete all AI goals from NMS entity

silk cape
#

where is it?

devout mirage
#

will my code work or not

novel phoenix
#

try this

#

wait

safe thunder
#

@novel phoenix hey

novel phoenix
#

its 1.8+

silk cape
#

where i need to put that code

novel phoenix
#

does 1.8 has NoAI tag

#

@safe thunder hey

silk cape
#

im not development

#

thats why im asking for help

safe thunder
#

why

fair abyss
#

want to summon a mob without ai? with commands @silk cape

safe thunder
#

I generating RealisticworldGenerator

silk cape
#

no, i want to all mobs in world

#

have no AI

fair abyss
#

mythic mobs can override default mobs

silk cape
#

include mobs spawned from spawners

novel phoenix
#

@silk cape you will probably have more success finding public plugin for this or hire someone to write it for you if you're not a developers yourself

#

@safe thunder don't understand the screenshot

#

can you provide more info

fair abyss
#

@safe thunder add utf support

safe thunder
#

[21:41:08] [Server thread/WARN]: Invalid entity id 'minecraft:v─▒nd─▒cator' at spawner minecraft:overworld:[736,22,-501]
[21:41:14] [Server thread/WARN]: Invalid entity id 'minecraft:zomb─▒e_v─▒llager' at spawner minecraft:overworld:[685,37,-624]
[21:41:31] [Server thread/WARN]: Invalid entity id 'minecraft:guard─▒an' at spawner minecraft:overworld:[278,97,-612]
[21:41:31] [Server thread/WARN]: Invalid entity id 'minecraft:v─▒nd─▒cator' at spawner minecraft:overworld:[271,97,-612]
[21:41:31] [Server thread/WARN]: Invalid entity id 'minecraft:zomb─▒e' at spawner minecraft:overworld:[271,97,-619]
[21:41:56] [Server thread/WARN]: Invalid entity id 'minecraft:enderm─▒te' at spawner minecraft:overworld:[-335,26,-571]
[21:42:07] [Server thread/WARN]: Invalid entity id 'minecraft:w─▒tch' at spawner minecraft:overworld:[-333,41,-239]
[21:42:15] [Server thread/WARN]: Invalid entity id 'minecraft:cave_sp─▒der' at spawner minecraft:overworld:[-292,104,-131]
[21:42:15] [Server thread/WARN]: Invalid entity id 'minecraft:cave_sp─▒der' at spawner minecraft:overworld:[-303,104,-131]
[21:42:38] [Server thread/WARN]: Invalid entity id 'minecraft:zomb─▒e_v─▒llager' at spawner minecraft:overworld:[-361,14,131]

#

@fair abyss I added

fair abyss
#

sure?

safe thunder
#

Same problem

novel phoenix
#

what OS

fair abyss
#

your all "i" has problem

safe thunder
#

java -Xms3G -Xmx3G -Dfile.encoding=UTF-8 -jar spigot.jar nogui
PAUSE

fair abyss
#

cus they arent "i"

safe thunder
#

yes

novel phoenix
#

is it your plugin?

fair abyss
#

dont think so

safe thunder
#

@novel phoenix RealisticWorldGenerator

fair abyss
#

is it cracked?

naive goblet
#
public class Test {
    final int pastTime = 0;
    public Test() {
      pastTime = new GregorianCalendar()
        .setTimeZone(TimeZone
        .getTimeZone("America/New_York"))
        .get(Calender.SECOND);
    }

    public int getTimeDifference() {
      int currentTime = new GregorianCalendar()
        .setTimeZone(TimeZone
        .getTimeZone("America/New_York"))
        .get(Calender.SECOND);
      return (currentTime - pastTime)
    }

}```
safe thunder
#

@fair abyss no Original I buyed

naive goblet
#

Maybe something like that @devout mirage

novel phoenix
#

are you running on windows?

naive goblet
#

idk if the methods are compatible but you get the point

safe thunder
#

@novel phoenix yes Windows 10 Pro Single Language Turkish

naive goblet
#

create a new instance everytime you want to check and let it be gcd after

devout mirage
#

But what about my code?

#

will it work or no ```
public class Test {

int pastTime = 0;

public int getTime() {
    Calendar calendar = new GregorianCalendar();   
    TimeZone tz = TimeZone.getTimeZone("America/New_York");
    calendar.setTimeZone(tz);
    int hour = calendar.get( Calendar.HOUR); 
    int second = calendar.get( Calendar.SECOND); 
    return hour+second;
}

public void setTime() {
    pastTime = getTime();
}

public int getTimeDifference() {
    int currentTime = getTime();
    return currentTime - pastTime;
}

public boolean minutesPassed(int minutes) {
    return getTimeDifference() >= ((60 * minutes)+ 1);
}

}

naive goblet
#

try?

novel phoenix
#

@safe thunder try running in PowerShell?

safe thunder
#

windows batch

#

cmd

novel phoenix
#

yeah, try launching in powershell instead

safe thunder
#

I try...

novel phoenix
#

does it work?

pure canopy
#

Hi, can you tell me what variable is used in tab reborn so that the name of the user comes out??

fair abyss
#

@safe thunder change your os's language

#

you can download it from settings

naive goblet
#

kingOf0 what mods have you been contributing to in forge?

frigid ember
#

Where do I post a config resource?

fair abyss
#

none of them is public

worldly heathBOT
stiff arrow
#

I'm able to delete and copy a world folder OKAY, but when I create I get a null error that's driving me nuts! 🙃

Bukkit.unloadWorld(worldName, false);
FileUtils.deleteDirectory(old);
FileUtils.copyDirectory(old, new));
Bukkit.createWorld(new WorldCreator(worldName).environment(World.Environment.THE_END));

[error]
java.lang.NullPointerException: null
org.bukkit.craftbukkit.v1_15_R1.CraftServer.createWorld(CraftServer.java:1068)
org.bukkit.Bukkit.createWorld(Bukkit.java:548)

Anybody have a suggestion?

fair abyss
#

full error maybe?

#

ex: which line gives that error

frigid ember
#

Where do I post a config resource?

naive goblet
#

Are you good in how the models works in forge?

fair abyss
#

not very much

stiff arrow
#

My error is on the createWorld line, no idea what's null there...

fair abyss
#

just know mcp

naive goblet
#

ah

pure canopy
#

Hi, can you tell me what variable is used in tab reborn so that the name of the user comes out??
humm

fair abyss
#

doesn't good at forge

naive goblet
#

well knowing mcp is handy as well

fair abyss
#

yep 😄

silk cape
#

@novel phoenix

#

i have some

#

code

#

from NoAi plugin

#

can you take a look on it

#

or someone else

novel phoenix
#

I guess?

silk cape
#

where i need to send

worldly heathBOT
silk cape
#

mobs have no Ai but water and pistons does not pushing them

novel phoenix
#

well

#

because that is how noai is supposed to work

#

if you need them to stop moving or attacking

stiff arrow
#

Bukkit.createWorld throwing this null error makes no sense.

fair abyss
#

just set your mob's speed to 0

novel phoenix
#

you should delete specific AI goals

#

that control moving and attacking behaviour

fair abyss
#

he sn't developer

#

he cant delete spec goals

silk cape
#

😅

novel phoenix
#

well he can ask someone to do that

fair abyss
#

so, he can only set their speed with other plugins

novel phoenix
#

and this channel isn't really an appropriate place for that

fair abyss
#

its the basic thing

#

true

silk cape
#

which plugin

#

do you know

fair abyss
#

mythicmobs

#

can set their speed

silk cape
#

ill try

#

thanks

stiff arrow
#

Any ideas why Bukkit.createWorld is throwing a null erorr when it only requires a name, and i'm giving it a name!

novel phoenix
#

can you paste full stacktrace at least

stiff arrow
#
    at org.bukkit.craftbukkit.v1_15_R1.CraftServer.createWorld(CraftServer.java:1068) ~[patched_1.15.2.jar:git-Paper-"827cc632"]
    at org.bukkit.Bukkit.createWorld(Bukkit.java:548) ~[patched_1.15.2.jar:git-Paper-"827cc632"]
    at com.mary.rubydragon.ResetEnd$5.run(ResetEnd.java:79) ~[?:?]
    at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:84) ~[patched_1.15.2.jar:git-Paper-"827cc632"]
    at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:461) ~[patched_1.15.2.jar:git-Paper-"827cc632"]
    at net.minecraft.server.v1_15_R1.MinecraftServer.b(MinecraftServer.java:1253) ~[patched_1.15.2.jar:git-Paper-"827cc632"]
    at net.minecraft.server.v1_15_R1.DedicatedServer.b(DedicatedServer.java:430) ~[patched_1.15.2.jar:git-Paper-"827cc632"]
    at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:1170) ~[patched_1.15.2.jar:git-Paper-"827cc632"]
    at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:959) ~[patched_1.15.2.jar:git-Paper-"827cc632"]
    at java.lang.Thread.run(Thread.java:834) [?:?]
naive goblet
#

Invoking undeclared fields?

rocky fulcrum
#

@stiff arrow your trying to delete a world file and re create correct?

stiff arrow
#

line 79 is create()

#

Yeah! Deleting and copying works fine

naive goblet
#

send ur code

novel phoenix
#

now paste full line 79

naive goblet
#

and all references from 79

stiff arrow
#

I stripped it down already but okay

#

there aren't any null refs

rocky fulcrum
#

I use the following on a plugin and it creates correctly

#

public static void createNewWorld(){
WorldCreator worldCreator = new WorldCreator(worldName);
worldCreator.generateStructures(true);
worldCreator.type(WorldType.NORMAL);
Bukkit.getServer().createWorld(worldCreator);
}

stiff arrow
idle zodiac
#

Hi! Apparently BukkitAdapter is not visible... any help?

stiff arrow
#

I'm able to create normal worlds okay too, just not ends

naive goblet
#

Occy reflection?

idle zodiac
#

XDDD

novel phoenix
#

bruh

idle zodiac
#

I took a break

frigid ember
#

Hey guys, what causes this? https://www.youtube.com/watch?v=WXK80olJgvs&feature=youtu.be

    @EventHandler
    public void onInteract(PlayerInteractEvent e) {
    Player p = e.getPlayer();

    ItemStack i = p.getItemInHand();

    MapMeta meta = (MapMeta) i.getItemMeta();
    MapView mv = Bukkit.getServer().getMap(i.getDurability());

    if (mv == null) {
        p.sendMessage("map not found");
    }

    mv.setCenterX(p.getLocation().getBlockX());
    mv.setCenterZ(p.getLocation().getBlockZ());
    Scale s = mv.getScale();

    Action ac = e.getAction();

    if (ac == Action.RIGHT_CLICK_AIR) {
        mv.setScale(Scale.FARTHEST);
    }

    if (ac == Action.LEFT_CLICK_AIR) {
        mv.setScale(Scale.CLOSEST);
    }

    meta.setScaling(true);
    p.sendMessage(mv.getScale().toString());
    }
idle zodiac
#

I needed to gain some braincells

stiff arrow
#

I am confused.

novel phoenix
#

did you grab WorldEditPlugin instance?

idle zodiac
#

yes

novel phoenix
#

did you cast it

#

to (WorldEditPlugin)

#

or smh

idle zodiac
#

ah

#

done

naive goblet
#

Casting is a nwb mistake but yeah you might wanna makea null check as well

novel phoenix
#

does it have methods to get adapters?

idle zodiac
#

wat

#

i know what you mean

#

but

#

what methods

novel phoenix
#
JavaPlugin checkForWe = getServer().getPluginManager().getPlugin("WorldEdit");
if(checkForWe != null && checkForWe.isEnabled())
{
  WorldEditPlugin we = (WorldEditPlugin) checkForWe;
  // check methods for we instance here
}
#

syntax might be incorrect

#

look up correct methods and class names yourself

idle zodiac
#

ok

deep olive
#

hello i have a problem my friend has minecraft pirate in which to enter my server what should i do

rocky fulcrum
#

server.properties Enable offline mode

novel phoenix
#

you mean disable online mode

#

also hurr durr stolen games bad

rocky fulcrum
#

how do you post code in the chat?

novel phoenix
#

use three of ` these bad boys

safe thunder
#

@fair abyss Do you know optimize 1.15 in mob lags ?

deep olive
#

thanks friend for help

idle zodiac
#

@novel phoenix Can I use BukkitImplAdapter?

#

That's the only one that will show up]

novel phoenix
#

Impl means

#

its implemented

#

means its not interface or abstract class

#

the difference is how you get it

rocky fulcrum
#

I have this BukkitRunnable that i call with halfBorder.runTaskTimer(Uhc.getPlugin(), 0, 5); but even though I have canceld the task when its called a 2nd time i get Already scheduled as 10 error ``` private static BukkitRunnable halfBorder = new BukkitRunnable() {
@Override
public void run() {
if(worldBorder.getSize() >= newWorldSize) {
worldBorder.setCenter(0, 0);
worldBorder.setSize(worldBorder.getSize() - 1);
} else {
Uhc.broadcastMessage("World size has halfed");
Bukkit.getServer().getScheduler().cancelTask(halfBorder.getTaskId());
}
}

};
novel phoenix
#

and because sk89q (rightfully) hates static references you're forced to do things the right way

idle zodiac
#

ok

naive goblet
#

Too many ppl avoid static to often ;/

#

But yeah it should be used in rare cases

idle zodiac
#

how do i use BukkitImplAdapter though?

#

it doesnt work lol

tame dagger
#

I am looking to set up a bungee cord server with different dedis for each subsequent server
How can I secure myself and are there any guides?

silk cape
#

@novel phoenix

novel phoenix
#

show your current code

naive goblet
#

@rocky fulcrum BukkitTask 😛

silk cape
#

i downloaded mythic mobs

naive goblet
#

much better

silk cape
idle zodiac
#

who

#

me?

novel phoenix
#

you

silk cape
#

is it there

novel phoenix
#

yes

idle zodiac
#

ok

#

com.sk89q.worldedit.world.World world = BukkitImplAdapter().adapt(world1);

#

idk how to use this

novel phoenix
#

@silk cape I've never used this plugin so I can't help you with configuring it

idle zodiac
#

i was just assuming that it would be the same as BukkitAdapter XD

novel phoenix
#

did you

#

use my snippet from above?

idle zodiac
#

where

#

yes

#

i have it

novel phoenix
#

does it work?

idle zodiac
#

uh

#

there aren't any errors

#

but i still can't use BukkitAdapter

#

idk how to get it to work

#

I feel so stupid rn

novel phoenix
#

BukkitAdapter adapter = we.getBukkitAdapter()

#

or smh like this

idle zodiac
#

XDDDDDDDDDDD

#

FFS

#

thank you

#

my brain hurteh

novel phoenix
#

learning the right way is hard

#

but it will help you in the future

idle zodiac
#

That doesn't work

novel phoenix
#

lemme find javadocs then

idle zodiac
#

Cannot resolve symbol BukkitAdapter

#

tf

naive goblet
#

Occy do you use Intellij?

idle zodiac
#

yes

naive goblet
#

Browse the dependency?

surreal rover
#

import it

idle zodiac
#

import wat lol

#

i have fawe we wg and spigot

#

in that order

novel phoenix
#

you don't need fawe

#

in plugin dependencies

#

remove it

idle zodiac
#

i do for schematic loading

novel phoenix
#

I mean

#

you don't need it in your IDE

#

most probably

idle zodiac
#

intellij does lol

#

it wont work if ii dont have it

novel phoenix
#

what won't work

dusty topaz
#

bruh are you still stuck on this

#

gimme a sec

idle zodiac
#

the fucking

#

iim

#

um

#

.paste

#

it wont load

dusty topaz
#

stack trace?

#

or whats the issue

#

show your code

idle zodiac
#

me?

#

ok

novel phoenix
#

from what I've heard

#

using FAWE on production servers might not be a good idea

#

because it sometimes breaks

worldly heathBOT
novel phoenix
#

in hilarious ways

idle zodiac
#

tf

#

XD

frigid ember
novel phoenix
#

@frigid ember what are you trying to achieve with this code and what isn't working

#

in text form

frigid ember
#

I'm trying to zoom in and out when I right or left click, but when I do it glitches

idle zodiac
#

welcome to hell

novel phoenix
#

you don't reapply

#

the item meta

#

back to map itemstack

#

i.setItemMeta(meta);

#

in the end

frigid ember
#

The meta doesn't work anyways I couldn't cast it

dusty topaz
#

@idle zodiac whats the issue

novel phoenix
#

@frigid ember you should check for correct item

dusty topaz
#

and he doesnt return in his check

frigid ember
#
Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.v1_8_R3.inventory.CraftMetaItem cannot be cast to org.bukkit.inventory.meta.MapMeta
#

I'm going to do that after I get the zooming working

idle zodiac
#

@dusty topaz So, I can't use BukkitAdapter, apparently its invisible. I;ve tried everythiung these lovely people have told me to do XD

naive goblet
#

Phaze use CraftBukkit

#

if you cant cast

dusty topaz
#

not the answer

naive goblet
#

Idk just said what was reasonable from what I saw

dusty topaz
#

that will never be the answer

naive goblet
#

But surely if he is going to involve nms then handle it through craftbukkit

#

Cant think of any other way 🤔

dusty topaz
#

thats not how it works

naive goblet
#

How innit?

rocky fulcrum
dusty topaz
#

if you depend on spigot you can use nms

#

a spigot server has nms inside of it

#

which is how it runs the server ... lol

novel phoenix
#

hey @idle zodiac

frigid ember
idle zodiac
#

@novel phoenix y

#

ye

frigid ember
#

Theres only that import anways

novel phoenix
#

BukkitWorld weWorld = new BukkitWorld(yourWorld);

#

by any chance?

naive goblet
#

Well if you're trying to convert and a CraftItemStack for instance and you need the Bukkit version of it lmao how else wouild you adapt?

idle zodiac
#

omg

#

my brain

#

thanks so much