#help-development
1 messages Β· Page 2154 of 1
ohhhh
why are you casting it
i have been trying to stress that for the last 10 freaking minutes
if (!(this.getMenu(player.getUniqueId()) instanceof PaginatedMenu menu)) {
return;
}
// do stuff with `menu`
But its really ugly to use an if everywhere only for that
That why i want to do add it directly into the getMenu method
java isn't exactly pretty
you. cant.
you are so frustratingly uncomprehending
I can feel Imajin just smashing his keyboard right now
I DID
i literally did
on everything i did
im actually in awe
dont orry yesterday i thrown a glass throw my window
bruh don't speak proper english so he has no clue what your trying to say
likely main issue
yes my english its not the greatest
And you gringos talk in a technically way that its not common
Ok so basically this is as good as it gets its not pretty, but thats okay java isn't always pretty
no one speaks proper english why its so hard to learn languages
This produces an exception
no soy un gringo
no puedes hablar ingles facil
es porque no puedes comprender
Si, no es que te estoy jodiendo, es que no te comprendo bien
nothing we can do about that so i guess hair pulling will have to last for a while
Hmn
practice makes perfect 
Let try to understand this
practice sucks
That what i want to understand
How is your classes structured
you're casting without checking
Yeah let start from there
^ 1
no siempre es un PaginatedMenu
si
I have to keep looking up these verbs I have the most awful spanish vocab
yes
corecto
I think i catch it
no, porque
Menu menu = this.getMenu(player.getUniqueId());
if (menu instanceof PaginatedMenu menu) {
// do stuff with `menu`
}
My goal is to only be able to use PaginatedMenu and InventoryMenu
Use π the π code π we π provide
Allright
if (menu Instanceof PaginatedMenu) return;
PaginatedMenu paged = (PaginatedMenu) menu;
Thanks, really thanks. And sorry for making the 2 of you mad
error will cause by this
@river oracle hes trolling
definitly
does he usually trol?

I think only conclure understand me
I think its time to take hair by hair from my head
No lo ignoro, es simplemente lo mismo si te fijas
if (menu Instanceof PaginatedMenu) return;
PaginatedMenu paged = (PaginatedMenu) menu;
does not equal what I comment to
Also im not using java 16
doesn't change anything
Menu menu = MenuHandler#getMenu(uuid);
if (menu Instanceof PaginatedMenu) return;
PaginatedMenu paged = (PaginatedMenu) menu;
Menu menu = MenuHandler#getMenu(uuid);
if (menu Instanceof PaginatedMenu) PaginatedMenu paged = (PaginatedMenu) menu;
Really im not trolling the code is the same
my lord
Oh im really im stupid, should be if (menu instanceof InventoryMenu) return;
I wnna shot me
I have just realized im really dumb
Menu menu = MenuHandler#getMenu(uuid);
if (menu Instanceof PaginatedMenu){
PaginatedMenu paged = (PaginatedMenu) menu;
}
I've sppon fed you the code you need just use it
poor Imajin
ive spoonfed him countless times
you poor soul
Menu menu = MenuHandler#getMenu(uuid);
if (menu Instanceof InventoryMenu) return;
PaginatedMenu paged = (PaginatedMenu) menu;
Now yes
sure!
Y2k i was not trolling
thats bad
why cant you just use. my. code
you're basically coutning on the fact that there are two interface implementations, and only two
I only have 1 interface, and inventory and paginated menu contains the same impl. The only diff is that the paginated one contains some etra methods apart from the inherited from the interface
code breaks? you mean an exception or something diff
yes because you wouldn't be accounting for another implementation
I mean the way you have it technically works but if you ever add any more interfaces your going to have issues 
You could just use his code and it'd work fine but 
Yeah my goal is only to keep in track 1 object, with common methods for each impls and be able to use impls methods that are not inherited from the interface
flexible code is good.
he does not understand that one bit
That what im looking forward
If I had a bat right now and you were sitting next to me I would wack you a couple times.
seriously scroll up throughout this entire conversation and see how he has not fucking done anything i said
I feel a tos breaker
Hey bruh dont get mad, i understand what you say to solve it. Im just looking forward if there any idea better for tracking my menus
I FOUND A SOLUTION FOR YOU
there
ISNT
HOLY FUCKING SHIt
usar tu cerebo SI TU TIENES
BRO VERANO I FOUND EXACTLY WHAT YOU ARE LOOKING FOR
I think im getting banned...
Oh really
I'm losing braincells by the minute
Please dont ban me
Please use your brain
bruh how old are you?
Im a child, i have 15y
english isn't his first language
I'm sure you could understand
bro
So in fact its solved
just accept what they're saying, why are you clogging up the chat for nothing
please I beg you.
im going to track you down and personally rip your fucking bolas pequenos out of your mouth
Yeah i dont know why i dont do that from the start. I think its that i get blcok when i doesnt work as how i want it
So it most my problem
you are seriously pissed.
read the entire conversation
I'd be pissed too
sure
we have made the tiniest speck of progress
Last one tooked likely 2h real clock
the fact I have a headache and I wasn't even here or helping for most of it
Me? I didn't do anything feel bad for imajin
I should be more sorry than you
wdymmmmmmmmm
you are fine just a bit slow ahaha
Because i literally fuck them for 1h20m
i will translate to english what happens to me, so you can udnerstand better
alright I'm tired gonna go watch anime and sleep
Allright, have a good night. Im sorry for you headache
And im sorry for you Imajin too
I think you killed him ngl.
yea he died
Like the bounding box thing
@lmajin u still with us?
well its okay good thing in the field of copmuter sicence he is completely replaceable
LMFAO
whats your issue
im sorry what\
here
I modded bungeecord itself, to add this to disable JLine
but not work
because I want to capture the console of bungeecord
oh fuck hell I would know I've not touched bungeecord
My problem is the following, I'm stuck on something and I don't know what to do. On top of that I am quite stubborn. Well, everything is much more difficult. It was all my fault, instead of using 1 what he said and leaving everything still. Well, don't reason and keep insisting if there was no other way. But I really apologize
doesn't bungee have a log file?
yes
depending on your project you could get away with trailing a log file
Its has
Question should be why are you capturing the log
no need to customize its output
you're literally gonna be reading the console, which is the same thing
well for input I usually use something like screen or tmux though you can also use IO files with linux
I usually do this while trailing the log file
I'm sure if your on windows ther eis some form of screen and tmux replacement you could use
not on windows
actively trailing the log is super simple as you can run it on another thread
yeah I get you
most people use screen already to keep the servers up so thats an easy access point for pushing commands
if you have a web terminal you could probably send http post requests
also cannot do that
what about keeping something like selenium open in the background while hacky its a simple and fast solution to your issue outside of just buying a VPS
I'm confused as to what exactly you're trying to accomplish here? Are you trying to forward the console output somewhere?
ok what about disabling jline
in a spigot jar
What
you can add -nojline to the parameters
huh
and it will disable the jline thingy, like it does not appear the >, and the colors are disabled.
and stuff,
like in a vanilla jar, which allows you to save logs and send commands to server.
no no he's talking more about the output what are you trying tod o with it
I'm trying to do the same thing on bunbgeecord.
you shouldn't need to touch the output log file
because I'm attempting to run multiple servers using 1 jar to control all of the servers at same time.
well it is possible
Uhhhhh that sounds more like you need to write some sort of controller over redirecting log output
no I already have that done
but I have to disable JLine on bungeecord.
because I cannot do it any other way,
it works on spigot
Why do you need to disable JLine on bungeee?
to be able to send commands??
add -Djline.terminal=jline.UnsupportedTerminal to your java command (somewhere before -jar) found this on a spigot thread
Mmmm welp I don't know how to help lol.
weΓ§Γ§
well
idek
either
because I like, copied code from how spigot does it to disable jline, and it still doesn't work
could be something with your host possibly
wouldn't doubt it
if your going to try to do something like this in the future I can't reccomend a dedi or vps more
oof sorry idk never done this shit on windows or a host
I believe you copied it from here.
hmmm
coincidence...
any ideas?
can I ask something more off-topic?
because there is a lot of thecnical people I want to know how I can create a program that checks all of 3 latter available minecraft names. how can I get information about player name?
(in java programming language bdw)
I know its possible otherwise namMC wouldnt exist
Mojang api
Use the mojang api
Did that before, very usefull
you want to check if someone has changed their name and what those names were?
What's the issue here?
Is that not supported anymore
The thread was from 2018
Oh nevermind I found it
1.12.2 ?
oh sorry, didn't notice that part
I just added target.spigot().stuff and it worked
Or I mean the red squiggle went away
Add .create() at the end
u cant set a player object in config
get the player's name
because right now ur just setting "name" to the whole player object, and player objects aren't serializable
Also itβs good practice to use uuids instead of names because players can change names and data is gone
thanks, it worked
I never used packets so far... But after I send openwindow packet, All items go invisible...
Any idea?
I want both of them
I want to check AVAILABLE 3 latter names
but mojang api should do it
I think
they are using UUID the name is a child of the UUID
you can get the name from uuid
how???
also you are using floats instead of integers as well. Floats take more resources in storing as well as performing calculations
I'd use something like https://github.com/Geolykt/Presence/blob/main/src/main/java/de/geolykt/presence/common/util/RegionatedIntIntToObjectMap.java (though you'd need to adapt it to use float arrays instead of atomic object arrays) if you need to store such amounts of data.
Also, are you sure you need such a huge array?
Although really a Map<Long, Float> or the fastutil equivalent would suffice for most people
you would be better off, splitting this array at even points
even though you will have more arrays, because they are a smaller size they are more manageable and more optimal in terms of contiguous memory
And array accesses are amazingly fast from my experience
I would probably create some kind of custom class for this, that kind of simulates buffers but with arrays or hashmaps
So even if you double or triple the amount of array accesses you will still see a comparable performance
this is one of those cases where more is better π
A lazily initialised 4D array is magnitudes faster than hashmaps, but at some point you don't need to care about such petty performance concerns
and then they wept, for despite all of their optimization efforts the next minecraft patch made chunk loading 10x slower
As long as you prevent (auto-)boxing, performance will go brrr
alternative to that, is uneven 2D arrays.
Hopefully valhalla improves the performance of that
hi, I am getting this error when starting my plugin. it is pretty much empty with only a event listener and the on enable and disable. can someone help me? https://pastebin.com/Mz5u1inB
Did you talk about the consumption of resources required for arithmetic operations or about the baseline memory space needed for a float?
Show code
You have a new MyPluginClass() somewhere
Probably at NoNames.java, line 5
Oh no, I means NoNames.java, line 10 heh
correct
You should only have 1 class that extends JavaPlugin, which is NoNames in your case
Your Listener class should not extend JavaPlugin
Use the plugin's logger
You may need to pass it through the constructor beforehand for this
well baseline memory to store a float shouldn't be that much more than a negative integer. The arithmetic on floats is expensive though in terms of memory and cpu
I am new to this so can you explain? π
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
thanks
So I'm trying to increase an integer's value which is in the config.yml
plugin.getConfig().set("Darkcoins." + e.getPlayer().getName() + ".darkcoins", AddUp);
plugin.saveConfig();```
The int's value is 1000 and I plusedit by 500. I did that but it still remains 1000, anyone here can help me?
Bru my english sucks
- Generally I would not store any savegame data as a yaml file
- Naming conventions reeeeeeeeee
- Do not store anything based on the playername
- You get and store with different keys
int AddUp = plugin.getConfig().getInt("Darkcoins." + e.getPlayer().getName()) + 500;?
Ym this?
π¬
Ouch
Ok
camelCase but yeah
I'm gonna just switch the e.getPlayer.getName to Uuid
I want to use a json file in my plugin and idk how to set it up. Ik how to make the json file but idk how to make my plugin read the file and edit it
can anyone help?
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.9.0</version>
<scope>compile</scope>
</dependency>```
I put it in the pom.xml file and it says `Dependency 'com.google.code.gson:gson:2.9.0' not found `
Noobie question..
How do I add a Vector to an Entity 'Item'?
where you are saving is different then where you are loading from
look at your set method and your get method, the paths where you getting and setting are different thus when you load up the value, it was never modified in config thus always 1000
what's the best way to convert world ticks to a normal hh:mm time?
I've looked it up and will continue to do so but if yall have any ideas let me know
20 ticks = 1 second
1 tick = 50ms
so the ideal way is turn the ticks into however many second, then however minutes
then you just keep going until no more remainders π
I am unable to fix this line.
https://paste.md-5.net/pixidavehi.java
Any help would be appreciated.
if (this.spread != 1.0) {
that is more than one line
well a vector is never gonna be the same as 1.0
What exactly do you want to compare there?
whenever item fall into endportal it will bounce back
What exactly must be 1.0 with the vector?
Also, bukkit or java or java incubator vector?
1.0 either needs to have a d or a f at the end so java knows which it is.
i dont think thats the issue 
Well, 1.0 is a floating point number, spread is a vector - so something is wrong there
But good point (though for 1.0 there is no difference between floats or doubles iirc)
By default it is a double either way
it indicates the amount of precision and for the comparison operator how many digits pass the decimal are considered
also I don't see where spread is specified of its type
vector
I just assume it is of some numerical value lol
top of the class
public Vector spread;
ah jumbled in there
Yeah, unusual class layout, but what can one do
yeah vector and float or double are not going to compare π
Now the question is what the person wanted to actually compare
Oh I think what they wanted to do
i imagine its |spread| they were after
@stray flare just get rid of the if statement, it is useless
of this if (this.spread == 2.0) {?
No, just get rid of it
Or make it if (true) if you need to have one
What you have here is a useless optimisation technique
god I hate web dev
The other question is why would you need to multiply the items velocity if it is going to be 0 most of the cases
Oh, dropNaturally might add some velocity at the start.
?jd-s let's see what the javadocs tell us
it does
Well it is unspecified
iirc there is some pop to items, I have done some work with it before
though I usually just apply my own vector
which imo should also be done here but whatever
oh wait this is the function method not the event?
function lol, I've been doing js for too long
yeah never mind then
Why.
shops:
shop1:
owner: eeced9a1-0f41-483b-870f-c826a0462d59
id: 1
Code:
public static void createShop(Player p)
{
Shop shop = new Shop(p.getUniqueId(), shops.size() + 1);
shops.add(shop);
if (!shopsFile.exists())
{
Main.instance.saveResource("shops.yml", false);
}
if (!shopsConfig.isSet("shops"))
{
List<String> shopList = new ArrayList<>();
shopList.add("shop" + shop.id);
shopsConfig.set("shops", shopList);
}
shopsConfig.set("shops.shop" + shop.id + ".owner", shop.owner.toString());
shopsConfig.set("shops.shop" + shop.id + ".id", shop.id);
saveConfig();
p.sendMessage(shopsConfig.getStringList("shops").toString());
}
why what
it sends me empty list, just []
What else did you expect?
what? this is the list
shops:
shop1:
owner: eeced9a1-0f41-483b-870f-c826a0462d59
id: 1
its not empty
But are the members strings?
You want a StringList, and it gave a String list - which is empty ofc because there are no strings
oh. hmmm
And that is a map, not a list
so I got this error: java.io.FileNotFoundException: C:\Users\PC\Downloads\GlobalMute Plugin\src\main\java\com\ytg667\minecraft\isMuted.json (No such file or directory)
from this command: @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { JSONParser parser = new JSONParser(); try { Object obj = parser.parse(new FileReader("C:\\Users\\PC\\Downloads\\GlobalMute Plugin\\src\\main\\java\\com\\ytg667\\minecraft\\isMuted.json")); JSONObject jsonObject = (JSONObject)obj; boolean isMuted = (Boolean)jsonObject.get("isMuted"); if (sender instanceof ConsoleCommandSender || sender.isOp()){ if (isMuted){ jsonObject.put("isMuted", false); sender.sendMessage(ChatColor.GREEN + "The chat is now unmuted!"); } else { jsonObject.put("isMuted", true); sender.sendMessage(ChatColor.GREEN + "The chat is now muted!"); } } } catch (Exception e){ e.printStackTrace(); } return true; }
Idk what's wrong here
ok, thx
A) You probably should not hardcode the path
B) Seperators might differ from system to system
I just copied it from here
C) What the hell are you trying to achieve here
change the isMuted in the json from false to true or from true to false
I don't understand
The issue you have here is that this won't work if the file is not present (so on 100% of other computers)
You need to somehow dehardcode the file location
One way is to have it be done relative to the plugin dir, which is the most popular approach
the yaml api exists for a reason
how to edit it to make a list?
like this or smth
shops:
- shop1:
owner: eeced9a1-0f41-483b-870f-c826a0462d59
id: 1
I still prefer my org.json:json, albeit this is less
There is no way to make it be a list
You need to create the list manually
no, how to edit code to make it create list
the file location is in the plugin folder
Unless ofc you are doing something cursed such as
shops:
shop1: "owner:eeced9a1-0f41-483b-870f-c826a0462d59,id: 1"
it is not, it is in the downloads folder
yaml.set("shops", shoplist)
not what they are asking
:o
?jd-s
so I should do getDataFolder("C:\\Users\\PC\\Downloads\\GlobalMute Plugin\\src\\main\\java\\com\\ytg667\\minecraft\\isMuted.json")?
I don't understand what you told me. why does that make me an idiot?
Where as the parent is https://hub.spigotmc.org/javadocs/spigot/org/bukkit/plugin/java/JavaPlugin.html#getDataFolder()
declaration: package: org.bukkit.plugin.java, class: JavaPlugin
Child is simply whatever you want
he is telling that you should save the files that your plugin needs in the resources folder of your plugin
Make sure to create the file however
are you usin intellij?
I do not
hm, then is there a way to get this "list"?
heh what
(original)
Iterate over all shops and add them to the list yourself
but how to get all this shops?
I know that using the resource folder is going to loop back to the same issue we have right now - the best would be to simply delete that file and create it programatically as that will force the user to not hardcode that file location
ah wait the file is global
It probably should be, but considering that the user does not understand file systems well enough I'd rather go with the local approach
thanks
I want to define a command creating a maze. How can I write the source code so that it will open an mcfunction with the maze data?
What exactly do you mean with mcfunction?
If you just want to create an alias for another command, see the commands.yml
No need to write a plugin in that case
Well in vanilla you use mcfunctions to load certain objects
On my spigot server I am also able to call the maze with /function test:mytest
I told you this yesterday; Rewrite the mcfunction to Java. Running them from a plugin isn't ideal
But I want to create a customizable command
you can create a customizable command with Java
it seems however you don't know java
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
any way to cancel the furnace smelting event from the FurnaceSmeltStartEvent event?
can u control when tnt explodes
uhm yes? primed tnt has a timer thats counting down to 0 xD
u can change that value obv
how do i reference it in spigot
TNTPrimed tnt = player.getWorld().spawnEntity(player.getLocation().add(0.5, 0, 0.5), EntityType.PRIMED_TNT);
doesnt like this
use the spawn method instead of spawnEntity
ty
spawn takes a Class<T extends Entity> instead of EntityType
TNTPrimed tnt = player.getWorld().spawn(player.getLocation().add(0.5, 0, 0.5), TNTPrimed.class);
i assume
Yea
any answers for this? xD
its not implementing the cancellable interface
but id be a waste to let the counter run pointlessly if i wanna cancel it anyway
only the FurnaceSmeltEvent is implenting the cancellable interface tho
well apparently setting the totalcooktime to 0 sets it to infinite
which suffices combined with cancelling the furnace burn event
Make sure you're not using the title to detect your inventory
if (timer.getOrDefault(p.getUniqueId(), 0) <= rn) return true; how do i make the default value a long?
nvm
how to get a furnace blocks inventory instance reference?
Ty
Just copy it's inventory ?
yea but like
the api doesnt seem to give the option to get the inventory list that belongs to a block
i have a block instance
like this
@EventHandler
public void onFurnaceBurn(FurnaceBurnEvent event)
{
Bukkit.broadcastMessage("FurnaceBurnEvent:");
Bukkit.broadcastMessage("Block: " + event.getBlock().getType().toString());
Bukkit.broadcastMessage("Fuel: " + event.getFuel().getType().toString());
if (event.getBlock() instanceof Furnace)
{
Furnace furnace = (Furnace) event.getBlock();
//...
}
}
cant you get that from a Furnace object
furnace.getInventory()
isnt supported in the api
o.O
what version u on
declaration: package: org.bukkit.block, interface: Furnace
1.18.2
the auto completer suggests a typecast to HumanEntity when i do .getInventory();
not sure what you mean isn't supported in the api
How could I detect an inventory without using the title? I always thought that was the only wayβ¦
u can use a wrapper, i can show u later
autocompleter doesn't mean there is an error
holder
but the wrapper wont persist beyond /reloads
honestly you're probably doing this backwards, if you create an inventory and then want to handle events in it you should temporarily register the inventory so you can check if it's the same object
you shouldn't use titles to detect different inventories
I did that mistake for a looong while
holders are not the way to go
main reason for this is because someone can spoof inventory packets with arbitrary titles and gain access to inventories they are not supposed to
@wet breach public abstract interface org.bukkit.block.data.type.Furnace extends org.bukkit.block.data.Directional, org.bukkit.block.data.Lightable {
} thats what i import
this has no .getInventory() member under the 1.18.2 api
maybe im using the wrong class?
wrong furnace
org.bukkit.block.Furnace
stop putting data in it
new package who this
hm?
apparently i cant cancel the FurnaceStartSmeltEvent event, so i set its smelting time to 0 which seems to equal infinity
by its behavior ingame*
at least my test item is in there for 10min without result xD
which defaults to 10s smelting time
declaration: package: org.bukkit.event.inventory, class: FurnaceSmeltEvent
thats the furnace smelt event
the event thats fired at a finished process
i wanna cancel it at the beginning though
which is the Furnace Start Smelting Event
which is not implementing the cancellable interface
so i set the smelting time to infinity instead and cancel the fuel consumption event
as a workaround
would I be in trouble if I made my webapp load chug jug with you with a 0.1% chance?
yes, when 1 item gets smelted it will call that
and then you can cancel it
and it reverses what happened
wdym
the way i can calculate the difference between two times and return numbers similar to this
then what fourteen said
i tried using dtstem.currenttimeinmilis and nanotime but it doesn't return me deckmore number
what
what are yo even doing
(System.currentTimeMillis() - lastClickTime)
return me 302394982093 like that
i want 0.230934 decimal number
thats the difference in milliseconds
like that
that's just for how long of an interval since the last click though
not how many clicks per second
Init) Assign start time to variable, reset counter variable
Action) Increment counter variable
Polling) Divide counter var with the different between start time and now
if you want clicks per second you'll have to measure a second
yes
i want it!!
Which 1 second is 1000 milliseconds.
You have to define a start and end window
this is the first time I've seen someone try to use positive affirmation to get code to work
maybe he's on to something
I am doing this because I need to receive exact numbers just like that image to be able to create an if
i dont need that
i just want the diference
what is window?
Is the start frame a constant or is it relative to the end frame (e.g. 5 seconds before the end frame)?
Duration
no
No to what?
let me send a log
private long lastClick;
public void click() {
lastClickTime = System.currentTimeMillis();
processedClick = false;
}
public void update(final float delta) {
elapsedTime += delta;
// final long clickDiference = (System.currentTimeMillis() - lastClickTime);
// plugin.sendMessage("Tempo de clique: " + clickDiference);```
uhhh
Just subtract the last returned value from the current one and then convert it to what you need.
take a look at TimeUnit
You already have something working here, just convert it.
wdym
Another example is 5 seconds ago to now
is there a way to ignore hitboxes, i.e have tnt on a players head and still let them hit other players
he inside a thread when the plugin start
Let me bring out mspaint
oh no he's minting a new nft
Please have some patience
xd
hey vinny you speak portuguese?
ye
this is a great shame
ty
TimeUnit.MILLISECONDS.toSeconds()
does anyone know how I can change the player list
i want my bungeecord server to have all the players on there visable in all server/worlds
though i dont see how to change the list itself
oh boy I don't think that's going to help him
nice draw
Your time window will be a deque
You add actions (which is a record(long time)) at one end, and remove them at the other once they go into the discarded space
Then you count the size of the dequeue and divide it with the duration of the time window
two can play this game
This wont work in their case
umadre
this is what he asked for
he just wants to know the time elapsed since the last click
They already have that however...
i just want the numbers look like that -
they failed to do that right
Just divide 1 by the duration then
deque is a interface?
OKAY FUCK EVERYONE IM OUT
you're just jealous you forgot to sign your nft
Thatβs it Iβm making the unix timestamp an nft.
boy you can go for millions of nfts with that
what a great idea
jesus bitcoin lost a lot of value, I better convert that to dollars as soon as the bidding is over
from 66k to 29k in about 6 months
yeah it's not looking so hot
It just gets tiring if for more than 2 years people go in and out asking the same low level questions and then are confused by the fact that a certain class is an interface.
No shit sherlock, it is.
also that scale is hilarious, how can you even get away with making a graph like that
the values aren't linear
it's a weird way to show that something lost over 50% of its value
when it occupies, what, 15% of the graph?
yet
hard to panic when you never bought it
only time I seriously considered it was in feburary of this year, thinking about putting 5 or 10k into it
do think I dodged a bullet there lol
it doesn't bother me, I find it hilarious
I doubt btc is going to drop to 0
and even if it does, it has a long ways to go still before that happens
the worse thing you can do is pull money out of investments prematurely especially when the market is declining
because it emits light?
well
the interface Lightable says its subinterface is Furnace
All Known Subinterfaces:
Furnace, RedstoneWallTorch
or has the api changed
since i see its 1.13
And what doesn't make sense there?
why doesnt Furnace implement Lightable then
A lightable is something that emits light and can be turned off and on. A furnace can be turned off and on
Package org.bukkit.block
Interface Furnace
All Superinterfaces:
BlockInventoryHolder, BlockState, Container, InventoryHolder, Lockable, Metadatable, Nameable, PersistentDataHolder, TileState
actually you know what, what was said earlier is demonstrably false, this is the worst crash, just look at a linear graph. Percentage-wise the only one that comes close is that first peak when it went from 12k to 6k, but now it went frrom 67k to 29k which is the biggest drop numerically and pretty much the same %-wise as the other peak
All Known Subinterfaces:
Furnace, RedstoneWallTorch
One is block state, the other block data
yes
so i gotta get the block data and set the islit value there
which i cant because it doesnt contain it arg
It is possible that you cannot set the lit value for a furnace
im cancelling the FurnaceBurnEvent and under the circucumstance that theres still fuel in it, it will emit light indefinetly and for free @quiet ice
so i obviously wanna disable it
that doesnt help
because im cancelling it
the problem is
that the event is being canceled
it's up to you how you want to read it but I'm looking at the larger trends and the current downward trend started on 11/8/21
so it doesnt update
iknow
but setting that has no effect
because cancelling the event prevents the block from being updated
already tried that
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/Furnace.html#setBurnTime(short)
Set burn time. A burn time greater than 0 will cause this block to be lit, whilst a time less than 0 will extinguish it.
You need to aply the block state afterwards
uh
like ive said
i already tried setting the burntime to 0
didnt work
emits light indefinetly
okay im going to try it again, confirm the error and then send the source code here
Oh, you need to set it to -1
We should read the fine print more closely huh
@granite owl
A burn time of 0 is undefined apparently
xD
thats what i used to cancel the FurnaceSmeltStartEvent
set it to 0
setting smelting time to infinity
Cooking and burn time are independent from what I know
@EventHandler
public void onFurnaceBurn(FurnaceBurnEvent event)
{
if (event.getBlock().getState() instanceof Furnace)
{
Furnace furnace = (Furnace)event.getBlock().getState();
FurnaceInventory inv = furnace.getInventory();
ItemStack is = inv.getSmelting();
if (is != null)
{
if (is.getType() == Material.EMERALD)
{
ItemWrapper item = new ItemWrapper(is);
if (!item.isCustomItem())
{
if (inv.getViewers().size() > 0)
{
inv.getViewers().get(0).getInventory().addItem(is);
}
else
{
furnace.getWorld().dropItemNaturally(furnace.getLocation(), is);
}
inv.setSmelting(new ItemStack(Material.AIR, 1));
event.setCancelled(true);
furnace.setBurnTime((short) -1);
Bukkit.broadcastMessage("FurnaceBurnEvent: CANCELLED");
}
}
}
}
}
thats what i use now
itemwrapper just checks if it has a PDC value
to seperate vanilla emeralds from custom items
so lets see
cause im creating custom items
and use emeralds as base item
im writing base code to seperate the behavior
@quiet ice the furnace keeps burning
indefinitly
being lit*
i guess early return exist for a reason x)
all interactive containers are cursed and utter pain
{
ew
}
If it works under paper - then that is great you can ignore spigot. Otherwise not so good but I doubt anyone can help you there
im using spigot
Spigot has a bunch of bugs
paper is a spigot fork
thats the purpose of a fork
Yes, and paper has less bugs and more predicable behaviour
i mean dont get me wrong, technically everything is working just fine xD no illegal items can be smelted, its not resource heavy and just works
Is there an easy way to check whether or not a block is emitting light?
the only thing bugging me is cosmetical
One plugin of mine works meh under paper but under spigot it is borderline unusuable due to spigot have cursed behaviour
the lit state has 0 effect on technical behavior
bukkit >>
E hola
and with the next proper smelting it updates itself
and it also only happens when u smelt a legal item and then swap it for an illegal one
xD
while having fuel
I think the best you can do is to file a bug report or something, but it wont go far considering that this is something that happens deep in nms territory
Oh
You never update the block state
huh
furnace.update() did super weird behavior based on my code spawning lots of emerald s
or wdym
huh
so
furnace.setBurnTime((short) -1);
will not have an effect until you call
furnace.update()
like this u say?
furnace.setBurnTime((short) -1);
furnace.getBlock().getState().update();
Oh, you must remove is too probably, but idk
nope, latter call is basically a NOP
sec lemme test
furnace.update() makes the furnace fire the cancel event indefinitly
prob because of my code before the update call
i suppose update() is a callback that checks for the current state and needs and thus its requesting indefinite times the use fuel event
which i cancel
I'd remove the smelting input if needed
and make another update call to
CB is only acceptable server software
yea
@quiet ice the problem is that i cancel the fuel consumption event and make an update call
which then calls the fuel consumption event
so i cant update the block from within an update callback ofc
I guess you want to prevent the ability to smelt items?
In that case, why not listen for the hopper events and inventory click events?
because i wanna make it look like the recipe doesnt exist
im using a dummy recipe
and use the events to set results
//Furnace Recipe for Custom Items
Bukkit.addRecipe(new FurnaceRecipe(new NamespacedKey(plugin, "recipe_furnace"), new ItemStack(Material.EMERALD, 1), Material.EMERALD, 1, 200));
Bukkit.addRecipe(new BlastingRecipe(new NamespacedKey(plugin, "recipe_blastfurnace"), new ItemStack(Material.EMERALD, 1), Material.EMERALD, 1, 100));
I did wonder how you could smelt emeralds
easiest way to handle this is probably going to be with packets. You can easily fool the client into thinking it is not lit when really it is
Probably the easiest option really considering that it is the only thing not working
literally its like 1 option change in a packet
to tell the client its state is not lit
XD
I think you can do it with data watchers, but idk
tbh like ive said
its not usable for anything than cheated light sources
and yea...
we know how efficient a furnace is xD
how can I make certain area around a player glow. I am using a Armor stand (invisible) and trying to make it glow but it just doesnt
u can make recipes for almost anything btw
I know
grenade recipe
mhm u need a dummy item because even tho u can create new items server sided via nms
and fool the client
the bukkit api doesnt support it
so unless u write everything in nms u need to use an existing material as dummy
and the emerald has one of the least usages
can you spawn fake light sources?
like I got 7 light sources, id like to spawn them
but invisble
so they light the area around a player
For some reason my list isn't being loop even tho I already loop it, I honestly have no clue about this, this is so weird.
Output: https://paste.md-5.net/osifiponog.cs
List<String> materialList = new ArrayList<>();
if (config.getString("material") == null) {
materialList.addAll(config.getStringList("material"));
} else {
materialList.add(config.getString("material"));
}
for (String name : materialList) {
System.out.println(name.toUpperCase());
}
it got printed, but the output is a list
getString("material") vs getStringList("material") :/
can you different values with the same key?
is it possible tomake my server not respond at all to a certain protocol?
no afaik
i don't see what's wrong with my code, can you explain?
why are you getting material as a string first and then as a stringlist?
it can be both
material: netherite_sword
material:
- "netherite_sword"
- "diamond_sword"
``` it can be like this
how can i add a , before the last character in a string?
substring stuff
It's like the value is [NETHERITE_SWORD, DIAMOND_SWORD, IRON_SWORD, GOLDEN_SWORD, STONE_SWORD, WOODEN_SWORD] even though I use Collection#addAll
wait wha is the problem that its printing like that instead of under e/o?
Yes, it's printing like that.
it should be like this, not like https://paste.md-5.net/osifiponog.cs
[ItemSkins] Loading 'doomhammer.yml' skins (from 'skins' directory)
NETHERITE_SWORD
DIAMOND_SWORD
IRON_SWORD
GOLDEN_SWORD
STONE_SWORD
WOODEN_SWORD
alright, i'll try it.
yup, size 1
lmao
[ItemSkins] Loading 'doomhammer.yml' skins (from 'skins' directory)
Size:1
[NETHERITE_SWORD, DIAMOND_SWORD, IRON_SWORD, GOLDEN_SWORD, STONE_SWORD, WOODEN_SWORD]
try replacing materialList.addAll(config.getStringList("material"));
with config.getStringList("material").forEach(materialList::add)
hmm i guess its taking the whole thing as a string instead of a list
add sysouts
same thing
ah
i think
config.getString("material") is not null, even tho I have it as a List on the config
i think its never null
yeah it's solved xd
im using this to initialize a datasource in a connectionfactory class based on the type of storage, does it look good or is there a better way?
can anyone help me out with LightAPI i am having issues importing it with maven for 1.15.2
?paste
yes sir
Cannot resolve authentication failed for https://jitpack.io/com/github/BeYkeRYkt/lightapi-bukkit-common/5.1.0/lightapi-bukkit-common-5.1.0.pom, status: 401 Unauthorized
https://paste.md-5.net/oriyeducut.xml can someone tell me whats wrong with my pomΓΆ
Anyone know why this doesn't work?
Bukkit.broadcastMessage(ColorText.translateAmpersand("&eβ’&cβ’aβ’ " + player.getDisplayName() + "&fjoined the lobby&7! &eβ’&cβ’aβ’"));
}```
oh god
Jesus sanitize this code
Also using the name to identify roles ??
Yes because I have a disguise system, if I use permission it won't be nice
How is this achievable in spigot, that it displays what you should input into that arg (here: [<target>])? Because it is not a tab complete
https://imgur.com/i3MI5ja
I know what it means, but whytf is it saying 401 for a public repo
chrome eating my ram rn
anyone?
bump x)
help
?ask
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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
this code does not WORKKK
uhm and what are you doing
modding BungeeCord to disable JLine
can someone show me an example of a pom for light api. I am very confused
like the -nojline you can add in spigot
whats Jline btw
this beautiful prompt, that's what JLine is.
Solved, just imported its jar rather than using mvn for this one
what about my problem π’
yes
wdym by "the files that your plugin needs"
your config files and stuff
has been compiled by a more recent version of the Java Runtimeim getting this but everything matches normal i dont know why
I don't have any, I just opened a new project to learn how to use json to store data
do java --version
and what are you trying to run
the java you're running the jar file is OUTDATED.
I have this command: ``` @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
JSONParser parser = new JSONParser();
try {
Object obj = parser.parse(new FileReader("C:\Users\PC\Downloads\GlobalMute Plugin\src\main\java\com\ytg667\minecraft\isMuted.json"));
JSONObject jsonObject = (JSONObject)obj;
boolean isMuted = (Boolean)jsonObject.get("isMuted");
if (sender instanceof ConsoleCommandSender || sender.isOp()){
if (isMuted){
jsonObject.put("isMuted", false);
sender.sendMessage(ChatColor.GREEN + "The chat is now unmuted!");
} else {
jsonObject.put("isMuted", true);
sender.sendMessage(ChatColor.GREEN + "The chat is now muted!");
}
}
} catch (Exception e){
e.printStackTrace();
}
return true;
}```
and it doesn't work. the console says java.io.FileNotFoundException: C:\Users\PC\Downloads\GlobalMute Plugin\src\main\java\com\ytg667\minecraft\isMuted.json (No such file or directory)
idk why
somebody answered me before but i didn't understand him and he said that he lost hope in humanity
Just store the parser
bruh
a maven project
what does that mean
Well the error just means that the file is not there
the parser variable
just create it
and store it
why are you creating it every single time that code runs?
17.0.2
should I create it in main?
building the jar
do java --version
yes
and send ss or copy the output
15.0.2
java version "15.0.2" 2021-01-19 Java(TM) SE Runtime Environment (build 15.0.2+7-27) Java HotSpot(TM) 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)
yea see thats the issue
what
where
in your pom
ah i pasted the wrong one sorry
?paste
guys I think a miracle happened today
I think we should make today a holiday
I hope you're sitting down for this one
i am
I told someone not to use the reviews section as a support room and they actually removed the review
I changed my main file to this, is that what you wanted?
public JSONParser parser;
{
parser = new JSONParser();
}
@Override
public void onEnable() {
// Plugin startup logic
this.getCommand("globalMute").setExecutor(new globalMute());
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
}```
woah
I damn near passed out typing that it was so powerful
we found the new "1000000 iq guy"
actually
just store it on the Command class
and then use that instance
and about the file exception