#help-archived
1 messages · Page 120 of 1
i learned basic asm math functions lol
ASM can be really hard to learn lol
Any that isn't a full blown computer
if I recall, now a days anything that requires ASM, it is generated by software instead of done by hand
@gleaming helm Do you have experience with JNI and C ?
since it can be so tedious and error prone depending on how large your ASM is
I don't really have a need for JNI so no
I write in binary lol
@keen compass I still do some ASM by hand
I find it pretty cool to be able to call C\C++ methods from Java environment though
c # gang where u at
@gleaming helm all I can say is kudo's to you for being able to lol, not everyone can XD
lol
@gleaming helm zoomer lol
thanks?
No language is truly better than the other change my mind
@naive goblet c# gang
shut up microsoft java
@stone rampart writes assembled machine code everybody
And if you think your language is best because you mastered it, you're wrong
l
Give him a hand
kotlin before c# probs 🙂
lmao
@stone rampart depends on what you are using the language for or what problem you are trying to solve
Kotlin is my second favorite language
Ah sorry://
Because realisticly, they both do the same things in the same way
Also fendi why you hate streams api in java
I mean, unless you have Java OS, Java isn't going to be better then say C or C++ if you are making drivers XD
use c or cpp
Don't use a stream to iterate over every block in a minecraft world
COUGH
FUCKING
MOJANG
Retrooper your language is not best because you learnt it. Shut it.
lol
Kevin_ you heavily optimize mojang's shiet with GraalVM
?
you should try it
Kevin I like the idea thanks indeed for sharing such smart methods
Retrooper your language is not best because you learnt it. Shut it.
@stone rampart i didnt learn c tho lol
That's not optimization, that's introducing instability and a complete hack
Kevin I like the idea thanks indeed for sharing such smart methods
@naive goblet its basics bruh
Lol just shut up
Switch to a fork that's dedicated to fixing that type of stuff
lol
I don't think it's unstable
dont use streams simple story
@naive goblet its basics bruh
@frigid ember **sarcasm
it is stable until it is not 😉
i've run a 1.15.2 server on it for several months and didn't have a single issue
ok
The whole c/cpp best language thing with no justification nor use cases is annoying af
It's pretty unstable if you're running multiple instances of the JVM and if even one of them breaks some things can potentially be damaged
i like making cheats in cpp
I'm running a cluster of servers with the goal of it being to appear as a single server
That's why it's important to me
my main use of it
Like super high stability
Ah sharding
Yeah bro I mod cheat engine to use it on roblox too
Exactly
oh wait I want to ask a question that no one answered me on Paper discord
/s
I am working on that as well
Omg a real question in this channel?
Asking to experienced developers here: Have you ever used or had any experience with Java's C.O.R.B.A modules? And what are your thoughts on them (yes I know that they've lately been removed since JSP 320 of Java 11) but I still think they are an amazing tool and am curious.
I haven't found much info about them online , so I'm trying to make an idea of their actual use case
@sturdy oar Probably because deprecated and then removed completely
Having not found much info should give you a clue as to why they are being removed 😛
In all modern versions of java
Well they have info but I think they've been deprecated since java 8
and completely removed on 11
java 👏 8 👏 is👏 not👏 lts
In all modern versions of java
java 8 is good prove me wrong
please stop
java👏 8👏 gets👏 no👏 updates
?
we went through this discussion 20000 times here
you're asking questions that have already been aswered
Just stfu
Or justify
Don't
?
Can somebody please mute this kid
Me and the boys use java 2
I actually learned on a java 2 book lol
real big servers use only Scala and java enterprise
kotlin is best
@sturdy oar false
i know it's a meme
LOL
real men use trinary
hah
who here is a real boomer
he such a boome
The reason they do that is because
Retrooper close thine mouth.
The reason is because they want to have their asses covered so they don't get sued for license infringement
i didn’t open it
You can't use the standard version of java 11 commercially
ok i stop
for example
Well technically java 8 is LTS and is supported till 2030 for corporate and 2022 if you pay for support. Otherwise Java 8 is EOL sometime towards the end of this year however. Java 11 is the next LTS and then its Java 16 after that.
You have to either use the enterprise version from oracle or the openjdk version
On the topic of spigot, java 8 is pretty much the only way to go
Barely any hosts have anything above java 8
lol
Ah, ok
either way I recommend updating anyways
Yeah please update to AT LEAST java 11
Java 14 is great especially with the updates they have done with the GC
i use java 8
I'm running java 11 for now but as soon as java 16 is released and stable I'm upgrading
i like jav 8
Oh the joy of running 100% custom code
kevin why dont u update ur mc
I am hoping in Java 16 native unix sockets are supported
yo LOMBOK gang anyone?
@frigid ember Java 11 has the same feature set as Java 8 you know right?
ik
currently native unix sockets are in the sandbox testing phase 😄
LombokGang
Wow did somebody find the other lombok annotations besides @Getter and @Setter
why shud i take 10 mins to install a new jdk with same features
I kinda know them all
Security I think
what they do
go read the doc.
^
i dont really use lombok
@frigid ember there is significant optimizations done to the JDK since java 8.
You also don't really use docs
i do
Doubt
just i dont plan on using it
Well JVM I should say
😅 nice joke, really laughed
but new things added to the JDK and some things removed/deprecated
Or
It's newer
but ok
@With was previously known as @Wither @frigid ember
DISCORD
So you should upgrade
i don’t use lombok, some peoples projects i was invited to used lombok so i had to install it ig
Yep ahah
I highly recommend updating to Java 14 😉
Poor mate wither is gonna have to cop the mention
FUCKACKASCK
ASCè
intellij lets u click a button generate -> getters and setters
most people use itnjust for that reason
Retrooper ngl I'm surprised you know what instances are
ik ofc not all just saying
LOL
oh that's nothing
stop flexin kev
400 lines?
we got the point u work with assembly and all sht
I have a 700 line class
each getter and setter is 3 lines
80% getters
same
And setters
Oh yeah true lol
data classes
makes it sound bad, i doubt 80% is getter and setter
I bet that's fun to scroll through
u barely do sht there
I mean, still comes out to about the same @sturdy oar only difference is you are just having lombok put the bytecode in there for you as opposed to you doing it yourself 😛
i feel like kotlin > lombok though
it works mindset isnt the bwst
It's like the core profile that handles punishments, donation history, etc.
we don’t do shit because it just wirks
Well, depending on how much software you work on, sometimes leaving things alone because they work is actually the best
i do a 100second for loop in start of my spigot plugin because it works boiz
don't fix what isn't broken you know, otherwise you just might break it 😛
let me guess
Vanish state, flying state, walk/fly speed, staff chat status and settings, need I carry on?
ig the for loop isnt broken
do you also make scheduled tasks with Thread.sleep() @frigid ember
so that mindset isn’t best too
lol
yea
oh god
LOL HE DOES
i do threadsleep
Use BukkitRunnable
OMG
USE TIMER
You're genuinely a clown
no
Read the docs
bruh
Blacklist his IP from the maven repo
you don’t get jokes
No but it's inline with what you've said
?
wait expects to be interrupted where as sleep isn't expected to. Wait doesn't throw a security exception where as interrupting sleep can do so
i said “i do thread sleep”
You saying you do that is perfectly in line with your code quality
Your attitude almost definitely comes from someone who uses thread sleep
And doesn't read docs
ThreadSleep attitude
He definitely does both
Why are you god damn rude to retrooper like wtf
He sleeps the thread inside a runnable 🤣🤣🤣
You should try having him DM you all his questions
i thread sleep inside my async call
he never asked me anything luckily
it gives best fps
Block him then just not a big deal
I did
Retrooper stop wasting your time and go learn some maths
he only knows skid
You see there are 2 different kind of questions, the one I and others make , who are genuinely intersted in learning, and @frigid ember 's questions
this became wayy to toxic lol
hey does anyone know how to do a packet listener?
or can someone point me somwhere where i can get information
@strange grove will have to either use protocollib or use reflection
well
I'd use protocollib
ok
I'd go with a library
well how do i use it
well glhf
takes a long time to understand
ok
but it's worth it
lmao
sighs in headcrab
is this an half-life reference
yes
Yep
see my name?
it's also a reference to spongebob
some good devs are douches like allegedly the dev who made the minecraft development plugin for intellij
Lol
but a much darker version of Mr.Krabs
allegedly
i said
i didnt say i claim it ffs
people call him toxic idk why
he seems alr
because people annoy him with pointless questions XD
and ping him sometimes for no reason
ok
You'd call me toxic but there are plenty of people that can ask question without being entitled who wouldn't say I'm toxic
I wouldn't call Kevin_ toxic, he helps me because i actually make proper questions
🖐️
kinda
Kevin just likes like to bash on my methods but isn't the first to do so 😛
kevins cofindence takes a blow
then u just idk what happened
i was surprised u helped
😛
Sure
and there goes his self esteem
but I don't take it as a toxic thing though
well
and his ego
I really am not taking any of this personally
what do i do rn that u disagree
obliterated
at the very least I understand the methods you throw out there as well 😉
Because nobody here knows me IRL
can I get to meet someone here who uses IdeaVIM on IntelliJ
@strange grove
lol
@sturdy oar I use vim a lot but not with IJ
kevin what do i do that you disagree with, as you said a lot of things.
Guys, move to #general. I'm sure many devs need help but are afraid of seeing their question lost
Yeah I agree let's move
@frigid ember generally not wise to ask such questions unless you are prepared for the potential answers
We're moving channels
sneaky beaky like says in irish voice
who?
a tutorial
he needed to break nested for
@strange grove nods with an even bigger confused look on his face
wondering how he got here
So guys, I have a problem with a crafting plugin I'm working on. So I spawn a fake player and open a workbench for it, and I open a chest inventory for the player typing the command, so when items are put into a 3x3 grid in the chest gui, I set the items to the workbench that is being set to the fake player. Then I get the result and set it to a certain slot in the chest inventory. However, I've come across a problem. When I click the item in the result slot, how do I get the item in the workbench to get clicked as well or remove the items used in the craft from the chest inventory?
and why he is shuffling around chat
PacketPlayOutSetSlot slot = new PacketPlayOutSetSlot(-2, 2,
CraftItemStack.asNMSCopy(new ItemStack(Material.DIRT)));
((CraftPlayer) p).getHandle().playerConnection.sendPacket(slot);
I've tried packet play out slot to make the player click the resulting slot, but that isn't working
And I've tried this
if (cic.getRecipe() instanceof ShapelessRecipe) {
ShapelessRecipe recipe = (ShapelessRecipe) cic.getRecipe();
for (ItemStack stack : recipe.getIngredientList()) {
if (stack == null || stack.getType() == Material.AIR)
continue;
inv.removeItem(stack);
}
and then he suddenly realizes he's gtg so Mr.Krabs leaves the chat.
Discord Server: @strange grove has left the chat
Hey guys, do you know how to fix this issue? https://www.spigotmc.org/threads/chest-gui-crafting.444173/
How long does it take to review a premium resource? It's been 2 days.
14 days ?!
takes a week mostly
someone know how I can fix this: No suitable driver found for jdbc:sqlite:sample.db I'm using minimize jar because I need the file to be less than 5MB, also I'm using this setting in maven-shade-plugin
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/services/java.sql.Driver</resource>
</transformer>```
Will you post your full maven pom.xml?
@languid pewter
Also did you run the maven install?
That's pom.xml
Also did you run the maven install?
@errant python I didn't think about that 😄 I'll try it
XD all good 🙂
Still same
Can you post the full stack trace?
Ok
Ok, hold on let me test a few things 🙂
Sure
If you need the source code, here is it:
https://github.com/TheProgramSrc/SuperCoreAPI/blob/master/src/main/java/xyz/theprogramsrc/plugin/MyPlugin.java
Ok after testing you maven, it checks out.
However, I remember someone asking me about this awhile back.
Try adding Class.forName("org.sqlite.JDBC"); before you attempt to initiate a connection.
It's already on it
Don't forget to also surround it with try{}catch(classnotfoundexcetption e){}
I use Exception usually
It uses less code than adding a lot of catch to a try{}catch with a lot of exceptions 😄
Specifying the exception has a greater chance of actually catching the correct exception, its some weird JVM thing.
Oh, I didn't knew that, I'll change that, but still not working
Ok after testing you maven, it checks out.
However, I remember someone asking me about this awhile back.
Try addingClass.forName("org.sqlite.JDBC");before you attempt to initiate a connection.
because this ^ is already on the code
the only way to fix this is set minimizeJar to false, but that will make the file size be like 8MB
Try using something along the lines of:
<configuration>
<minimizeJar>true</minimizeJar>
<filters>
<filter>
<artifact>sqlite:sqlite</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>Something-else:Something-else</artifact>
<includes>
<include>**</include>
</includes>
</filter>
</filters>
</configuration>
I'll try it
In this case you need to change it up a bit. But the code concept works.
ok
@languid pewter If you need more reference heres the documentation: http://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html
https://www.spigotmc.org/threads/chest-gui-crafting.444173/ Anyone know how to solve this?
@frigid ember Talk me through your problem.
I'm trying to make hypixels crafting, so I spawn a fake player but open a workbench for it, so that I can get the crafted result. But I don't know how to subtract the items I use from the inventory the real player has open. Is there any way that I can force a craft to happen or make the player click on an inventory they dont have open? @errant python if that makes any sense
Well I have what looks like this, except for when I click in the slot 24, I want the items in the 3x3 grid to dissapear as if the item is actually being crafted. I currently have it so that whenever items are added to the 3x3 gird, they are added to a workbench as well, so the result in slot 24 is the same as slot 0 of the workbench, but when I click on slot 23 I'm stuck on the part where I can get the items used in the recipe to be removed but leave the items not used
@errant python
maybe this.inventory.setItem(SLOT, null)?
I don't remember what is the exact method
I think that would just set the result to air, but I'm trying to remove only the items in the 3x3 grid of the chest gui and workbench gui
this.inventory.setItem(SLOT, null) :: If this wroks just loop through those slots.
I don't want to remove items not used in the recipe though
then remove the specific amount
12, 31
How would I get the specific amount?
this.inv.getItem(slot).setAmount(amount);
Yeah but how would I get the amount from the recipe?
Or remove the itemstacks
It you have 12 blocks and an item-stack of 6 it'll take 6 blocks
Well I mean if I have a recipe like this
I want to keep the extra wood in the inventory
Or this, I want to keep the extra wood and sticks
yeah, like this:
@frigid ember
ItemStack item = this.inventory.getItem(slot);
item.setAmount(item.getAmount()-1);
this.inventory.setItem(slot, item)
do that with a loop through the slots of the crafting table
No, that wouldn't work as intended
would set to 0 for instance
eclipse is booting up
not remove
Some recipes require more than 1 item in the slot
player.getInventory().contains(Material.ENDER_PEARL
consumeItem(player, 1, Material.ENDER_PEARL
Maybe I can get answered now, this is about my 3rd time asking this. Where is the logic for Water pushing minecarts?
public boolean consumeItem(Player player, int count, Material mat) {
Map<Integer, ? extends ItemStack> ammo = player.getInventory().all(mat);
int found = 0;
for (ItemStack stack : ammo.values())
found += stack.getAmount();
if (count > found)
return false;
for (Integer index : ammo.keySet()) {
ItemStack stack = ammo.get(index);
int removed = Math.min(count, stack.getAmount());
count -= removed;
if (stack.getAmount() == removed)
player.getInventory().setItem(index, null);
else
stack.setAmount(stack.getAmount() - removed);
if (count <= 0)
break;
}
player.updateInventory();
return true;
}
Here is some of the code from my plugins @frigid ember, you should be able to repurpose it.
How would I determine how many of each block the recipe requires in each slot?
Thats the part Im having trouble on
@frigid ember Saved templates that it attempts to match?
Yeah I understand if statements, I don't know how to get the amount required in a recipe
@errant python wdym saved templates?
in config.yml
@languid pewter Yes or saved arrays.
create a path like:
Crafts:
MyCraft:
- 'MATERIAL:AMOUNT;MATERIAL:AMOUNT;MATERIAL:AMOUNT'
- 'MATERIAL:AMOUNT;MATERIAL:AMOUNT;MATERIAL:AMOUNT'
- 'MATERIAL:AMOUNT;MATERIAL:AMOUNT;MATERIAL:AMOUNT'
@frigid ember You could have a bunch of valued arrays that it runs against. Ones that match materials and amounts get run.
@errant python about my issue with sqlite, im still having troubles:
I was trying to avoid that, I did that in the older version but I want it so that if a custom recipe from another plugin registers you won't have to add it to the config in this plugin
@languid pewter Its your maven filtering.
@frigid ember What format do other plugins use?
@errant python I'm using this filter:
<filter>
<artifact>org.slf4j:sqlite-jdbc</artifact>
<includes>
<include>**</include>
</includes>
</filter>
Try just sqlite.
@errant python they register the recipes through bukkit
@frigid ember you mean like this?
https://www.spigotmc.org/wiki/recipe-example/
Does anybody know where the water logic for pushing minecarts is located?
@timid wagon To do what?
Well I'm trying to fix a plugin that makes minecarts link together and the way it works is that it converts all minecarts to their own minecart, and there is a bug with the converted minecart not being pushed by water.
Hi, I hope you can help me, I am making a plugin (my first plugin) and something has happened, the commands I have made do not work, before they did and now they do not, esot tells me when I enter Eclipse, I am Spanish and I speak Spanish If you do not understand something, I will explain without problem what it means
@languid pewter
Another example:
<filters>
<filter>
<artifact>junit:junit</artifact>
<includes>
<include>org/junit/**</include>
</includes>
<excludes>
<exclude>org/junit/experimental/**</exclude>
</excludes>
</filter>
</filters>
Hope thats more consise.
ok, thanks
Alr, just ping me
What does that mean? Sorry, I'm new :( @errant python
@timid wagon Try looking here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Minecart.html
Alright will do, I'll let you know how it goes.
Cross-reference this code: if(entity.getLocation().getBlock().getType().equals(Material.WATER) || entity.getLocation().subtract(0,1,0).getBlock().getType().equals(Material.WATER)){
@timid wagon
@balmy sorrel What are you coding your plugin in? (And don't worry about it 🙂
Where'd you find that
Mine carts are entities.
@timid wagon Lmk if that helps you 🙂
@balmy sorrel My dude! Whatcha coding you plugin in?
Not really helping me :/
Or at least how are incorperationg node.js into your plugin?
@errant python Sorry, I don't know :(
Could you drop you code in DM's?
@timid wagon
I'm not sure if minecarts are pushed in water like other entities however
@errant python do you know what can I exclude from sqlite?
because including all just put me at the start
I have minimizeJar enabled, all that size come from sqlite
@languid pewter I do not. Maybe exclude some of the imports your not using??
@errant python
without sqlite I have 800KB
You'll need to exclude the aspects of SQLITE your not using.
Ok man, maybe try <artifactId>sqlite-jdbc:sqlite-jdbc</artifactId>
@languid pewter
for the filter?
Yeah
I found it, its org.xerial:sqlite-jdbc
Idk if thatll work but its worth a shot
do you know if bungee have implemented sqlite inside the jar?
I do not.
Sorry :/
NP
does anyone know how to access something in another public void class?
it would rly help!
depends what you are trying to access
but if its something like a local variable, make it into a field
does anybody know the best way to hide your numeric server ip(not the domain one) from the public....???
@frigid ember how so?
well i can't really determine unless i have an example of your code
well
also @frigid ember use Bukkit.dispatchCommand()
can't really help if i don't have an example
well
im trying to get
name
and i'm trying to put it into a hash map
and when it goes into this hash map
it will dispense the name of the img somewhere else
`public void ImgCommand(final CommandSender sender) {
if (sender instanceof Player) {
Player player = (Player) sender;
World world = Bukkit.getServer().getWorld("world");
Location l = player.getLocation();
Collection<Entity> nearbyEntities = l.getWorld().getNearbyEntities(l, 8, 8, 8);
}
}`
hello
public void ImgCommand(final CommandSender sender) {
if (sender instanceof Player) {
Player player = (Player) sender;
World world = Bukkit.getServer().getWorld("world");
Location l = player.getLocation();
Collection<Entity> nearbyEntities = l.getWorld().getNearbyEntities(l, 8, 8, 8);
}
}```java
minigameslib isnt working
dang it
@frigid ember something like Bukkit.dispatchCommand(getServer().getConsoleSender(), "say hi");
@strange grove what's the code for the method you are trying to get the name from
i need help
`if (plugin.frameManager.doesFrameExist(name)) {
sender.sendMessage(MESSAGE_LOADER.getMessage("create.error.exists", "create.error.exists"));
return;
}``
nvm
I think i found irt
i pressed ctrl
and pressed my mouse on name
it took me to the top of the method
so yeah
and this is what I get it
so what exactly are you trying to access
the name of the img
and when i get that name
im going tell the player if it is near
because it would identify it and tell me where it is what it is
and It comes from item frames
so I want to do
ok but where is it in the code
yes
I held ctrl
and that was the source of it
this is not exactly my code as I stated earlier
I want to edit for personal use on my server
and i'm tweaking it
so basically you want the name in plugin.frameManager.doesFrameExist(name)
you'll have to find where the name is declared
and the ability to detect that specific image
and i'm using a
hash map to store this
and give it to the other public void
I can show you that cod e too if you like
@frigid ember the string is supposed to be a command
``HashMap<String, String> imgname = new HashMap<String, String>();`
i used "say hi" as an example since it runs /say hi
if you're running it in the join event you can just get the player from the event
yes
.getName()
Does anyone mind helping me with creating a pathfinding goal and using it for certain players? I also need help using the EntityMetadata packet, im not using ProtocolLib because I need it to be standalone for better editing
it would be event.getPlayer().getName() but yes
not a spigot question, but how do i use java 14? i installed it but when i use java -version it still says im using java 8
code?
event.getName grabs the event's String field "name"
show us more code.
You forgot 1 implementation.
I'm not gonna spoon feed you it.
You forget to implement 1 thing.
What could it possibly be?
🤔
also remember to space out the command
What are you trying to replicate exactly?
and or accomplish; restricting players from joining the server?
If you wish to restrict players from connecting there's a special Event for just that, ever hear of anything that starts with Async?
and ends in Event
AsyncPlayerPreLoginEvent
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/AsyncPlayerPreLoginEvent.html
Kicking a player on join still allows them to join for a split tick; than kicks them a tick after join.
It is poop.
Skript is frowned upon by majority.
Learn Java, I was in your shoes a few years ago I know how it feels.
But spoon feeding isn't the way.
really the only good thing it is for is prototyping what you can do in java
ok
so I want to have tha hash map get the name what do I do ?
where is the name declared
it is declared in a class called commands
and it is also declared
in the command
almost on the very top
in the afcreate command
taking the args
and giving it to name
well the first args
or the 0th
in computer programming
rihgt?
why cant you just put it in the hashmap directly
such as map.put(name, otherobject);
whatever you are trying to store in the hashmap
yes
hashmap is 2 values, it would be String and something else
so you can store the name and some other object
so something like this? imgname.put(name,String);
the only problem is it's underling the string in red
what 2 objects are you storing in the hashmap
and i'm not sure if I did it right or just plain stupud
well
a String
and another String
HashMap<String, String> imgname = new HashMap<String, String>();
see?
is that the way you would go about it?
wait then what would the other string be?
cause i already put name
and
i honestly don't know what you are trying to accomplish so i cant say what way i would do it
I see what you're saying
and you tell me, you chose a hashmap so you must have 2 strings to store
if you only need the name i would go with an arraylist
well instead of declaring a hashmap and doing map.put
you would make a string arraylist and do list.add
so something like this ?
ArrayList<String> imgname = new ArrayList<String>();
ArrayList<String> imgname = new ArrayList<String>();
yes
ok
and then you add the name to it
yes
np
I know this is hassle for people like
u
the smart guys
🙂
tryign to answer everyones questions
gl
thx man
again many thx
I will pester you again if I have problems
🙂
glad i was able to help, gl on your project 🙂
@frigid ember Did someone help you?
Just making sure 🙂
I saw your question:
Sooo...
How do I execute a console command, if a player joins the server (I can't find any tutorials x_x)?
@frigid ember
Wait... What XD
Alright glad to hear it 🙂
is there a gamerule to autosmelt?
@pastel igloo No...
Np!!
@frigid ember
I need help!'
and i'm in need of your services!
actually that's the same thing but whatever
anyway here's my problem
I think it does not know what i'm talking about
I can show you the code
@Command(name = "ImgName",
aliases = {
"In",
"ImageName",
"ImageNameDetector"
},
usage = "/ImgName",
fallbackPrefix = "animatedframes")
public void ImgCommand(final CommandSender sender) {
if (sender instanceof Player) {
World world = Bukkit.getServer().getWorld("world");
for(Player player : Bukkit.getServer().getOnlinePlayers()) {
Location l = player.getLocation();
for(Entity entity : player.getNearbyEntities(5, 5, 5)) {
if(entity instanceof ItemFrame) {
ItemFrame itemFrame = (ItemFrame) entity;
if (entity == imgname){
player.sendMessage(ChatColor.BLUE + "This is " + imgname + ".");
}
}
}
}
}
}
@anyone?
So people, any chance someone knows a txt file or a source that can help me transtale the fields of the nms packet classes for 1.8.8 and 1.7.10 mc server
Like
PacketPlayInFlyingPacket field a
PacketPlayInFlyingPacket field onGround
Like if maybe there exists a changelog file containing that info
I know there exists mapping for that for 1.15.2 but there were changes to packets since these versions and I cant really afford to do mistakes with what Im making
You can find the official mojang mappings for latest publicly
not sure if they exist for 1.7.10 though
I need help!'
@strange grove
You need to be more specific and concise.
@heady geode You may be able to look at older version's of Geyser.
Geyser? 🤔
Its for translating bedrock packets to java packets for cross platform play.
It may go back to 1.7
Its been around for awhile so, id take a look at that.
Oh I see, it may like have the packet classes translated to their original names and not obfuscated ones?
Yes.
Well tnx I'll take a look
Hope its helps!
Seems like I cant find packet classes in the geyser repo
?
@heady geode Im sorry to hear that :/
import spigot nms 1.15
then type
net.minecraft.server.v_1_15_R1.PacketPlayInUseEntity for example
Anyone know why this is a thing: https://www.spigotmc.org/threads/advancements-and-server-messages-dont-show-a-prefix-between-the-prefix-and-username.443608/
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1561)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at net.frozenorb.bridge.Bukkit.Profiles.Profile.getActiveGrants(Profile.java:59)
at net.frozenorb.bridge.Bukkit.Profiles.Profile.refreshCurrentGrant(Profile.java:145)
at net.frozenorb.bridge.Bukkit.Profiles.Profile.importSettings(Profile.java:55)
at net.frozenorb.bridge.Bukkit.Profiles.Profile.lambda$new$0(Profile.java:46)
at net.frozenorb.bridge.Bukkit.MongoManager$6.run(MongoManager.java:233)
``` ?
net.frozenorb.bridge.Bukkit.Profiles.Profile.getActiveGrants(Profile.java:59)
Whatever that is did a dumb by tryna access something that was being modified
We'd need to see code
But, quite simply, don't modify something that you're iterating
return grants.stream().filter(Grant::isStillActive).sorted(Comparator.comparingInt(o -> o.getRank().getPriority())).collect(Collectors.toList());
is line 59
So, something modified the contents of grants, probably; need to ensure that that can't happen
Frozen orb skid?
The owner askedd idk lol
Tell me I’m not the only one who’s noticing a clear IP rights violation
Funny thing is
That's not even a real FO plugin
That's a shitty remake made by a dude named C0an
@frigid ember You should link your server owner: https://skidbin.net/paste?t=99WQ6R
what is this?
😐 I think you know exactly what it is
Not really just know the link says "skid bin" lol...
I don't help people who illegally attempt to profit off of other people's work
yea he just asked me to get it to work i didnt ask anything...
Got that link from a friend after sending your laughable request for help
but exactly is the link meant for?
It's a link to an explaination and a zip download of the rest of the remade FO plugins
Which includes the original to the one you're skidding
Which, as explained above, isn't even a real FO plugin
It's a shitty remake
The links on it doesnt even work lol...
whats the point in sending him that if it doesnt even work
Look my point is that you shouldn't be copying other people's work without credit
That's actually against the law in most places, and it's almost certainly against any kind of licensing agreements.
i was never told who it was by i was just told to fix something for him and thats it lol..
but what he really wants is just the original plugins
yea, i figured that out after you told me, but he just wants something like originals or originals
Hey guys is there a way to set the ID of a Task?
with bukkit api no
Cause' I have the problem that I send an Actionbar every few ticks(Custom Health) and I have to cancel the Task that sends it to send it aigain so it's refreshed
?xy
Asking about your attempted solution rather than your actual problem
I tried that
wdym you tried
Doesn't work
eh
I already tried getting the ID but it doesn't cancel it for some odd reasom
Chances are that's an issue with your code
Don't know why setting the id would somehow help you cancel the task regardless
^ xd
You may also want to look at BukkitRunnable that makes cancelling easier by storing the id for you
public static void cancel() {
Bukkit.getScheduler().cancelTask(taskToCancel);
}
why is it static?
seems like youre using an instance variable, not really nice to do that statically
It's static so that I can call it from other classes
why not keep a reference to that class where you instantiate the task?
?
how do i get if a mob is hostile
But how can I call it from other classes if don't use static?
store a reference to the class' instance in the main class probably
or the id sure
OOP
private class Class {}
public onEnable(){
timer = new Class();
}
public Class getClass(){
return timer;
}
so you'd get the class using the plugin's instance
instead of just having it be static
that way you can have multiple Timer classes if you want going at once
public class MyClass() {
private int taskToCancel;
...
public MyClass() {
taskToCancel = //Your task id here etc
}
...
public void cancel() {
Bukkit.getScheduler().cancelTask(taskToCancel);
}
}
public class MyOtherClass() {
public void method() {
MyClass m = new MyClass();
m.cancel();
}
}
Thanks I will try it
get its target probably
@torn robin i mean any mob that can be catagorised as a hostile
Monster extends LivingEntity i believe
si
Blaze, CaveSpider, Creeper, Drowned, ElderGuardian, Enderman, Endermite, Evoker, Giant, Guardian, Husk, Illager, Illusioner, PigZombie, Pillager, Raider, Ravager, Silverfish, Skeleton, Spellcaster, Spider, Stray, Vex, Vindicator, Witch, Wither, WitherSkeleton, Zombie, ZombieVillager
slime isn't part of it because slimes are stupid
But how do I now start my task again?
It's fine I figured it out
Doesn't work
For some odd reason it doesn't cancel the task
You've to write a new BukkitScheduler#runTask...
?
public void SendActionBar(Player p) {
actionbar = this;
taskToCancel = Bukkit.getScheduler().scheduleAsyncRepeatingTask(Main.getMain(), new Runnable() {
int hp = Main.yamlConfiguarationhealth.getInt(p.getUniqueId().toString());
int def = Main.yamlConfiguarationdefence.getInt(p.getUniqueId().toString());
int currenthp = Main.yamlConfiguarationcurrenthp.getInt(p.getUniqueId().toString());
@Override
public void run() {
Main.sendHealth(p," §c"+ currenthp + "§f/§c" + hp + "❤ " + " §a "+ def + "✸ ");
}
}, 0, 20L);
}
If you want to restart it, then just call your SendActionBar method again
it will restart it and update the task id
Yes
Cause if you start two task, one will lost it's id because your taskToCancel is updated when you launch a new one
ohhhh shiiiii
What could I do about that?
You know before I just used to cancel every single Task that is running in the plugin
And then restart every single one of them
But that's probably not the best thing you could do for Server Performance xD
You should save a taskId for each player
You have to choices: - use a map with key UUID and value TaskID
- create a player object which takes in parameter taskId (you can then implement a start method which check if there is no running task, if there is one it can stop it before launching a new one)
But how do I get a new TaskID for every single Task without overwriting the others?
int taskID = Bukkit.getScheduler().scheduleAsyncRepeatingTask()...
yourCoolPlayerMap.put(player.getUniqueID(), taskID)
Then to get it: yourCoolPlayerMap.get(uuid goes here)
HashMap<UUID, Integer>
Yeah but the TaskID but be the same for every player
What do you mean?
Am I stoopid?
No, you're just confused
Yeah probably xD
Each time you call sendActionBar, it creates a new task for that player right?
Then each time you call this method it will creates a new taskID
And if you cant to stop it for a specific player, just stop the corresponding taskID
Cos each player will have one task
If you want to cancel the task within the method, use a BukkitRunnable so you can use this.cancel
I'm too stoopid to use my HashMap
I can't access it in the same class
I don't get why xD
I mean what the f
public HashMap<UUID, Integer> taskToCancel = new HashMap<>();
That should be right?
how do I do like every 30mins it sends a message?
Noice no I can't run my sendscoreboard method anymore what the hell
Show it
public static SendActionBar actionbar;
public SendActionBar() {
actionbar = this;
for(Player p : Bukkit.getOnlinePlayers()) {
taskID = Bukkit.getScheduler().scheduleAsyncRepeatingTask(Main.getMain(), new Runnable() {
int hp = Main.yamlConfiguarationhealth.getInt(p.getUniqueId().toString());
int def = Main.yamlConfiguarationdefence.getInt(p.getUniqueId().toString());
int currenthp = Main.yamlConfiguarationcurrenthp.getInt(p.getUniqueId().toString());
@Override
public void run() {
Main.sendHealth(p," §c"+ currenthp + "§f/§c" + hp + "❤ " + " §a "+ def + "✸ ");
taskToCancel.put(p.getUniqueId(), taskID);
}
}, 0, 20L);
}
}
omg ^^
Put your taskToCancel.put(p.getUniqueId(), taskID); in front of the task
not inside
What's your Main.sendHealth method?
I can't put it in Front
Yeah I did it now but the real problem is that I can't call the method anymore outside of this class
Do you know what"static", "public / private", "instance" mean?
isn't there an ActionBar class that the spigot API provides
In what version
"new"
I'm in 1.9
🤦
To my defence I used to be in 1.8
wow upgrading from 2014 code to 2015 code
public static void sendHealth(Player p, String text) {
ActionBarAPI.sendActionBar(p, text);
}
And yes I tried doing it without an Api
And what's ActionBarAPI#sendActionBar ?
i assume a third party plugin
Yes
K I think the saving of the TaskID didn't work
public void cancel() {
for(Player all : Bukkit.getOnlinePlayers()) {
int task = taskToCancel.get(all.getUniqueId());
Bukkit.getScheduler().cancelTask(task);
}
}
That should be right for cancelling it shouldn't it
?
Should be right
In the Console it says that int task = taskToCancel.get(all.getUniqueId());
is a null pointer exception
And to save it that should be right:
public void SendActionBar() {
actionbar = this;
for(Player p : Bukkit.getOnlinePlayers()) {
taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(Main.getMain(), new Runnable() {
int hp = Main.yamlConfiguarationhealth.getInt(p.getUniqueId().toString());
int def = Main.yamlConfiguarationdefence.getInt(p.getUniqueId().toString());
int currenthp = Main.yamlConfiguarationcurrenthp.getInt(p.getUniqueId().toString());
@Override
public void run() {
Main.sendHealth(p," §c"+ currenthp + "§f/§c" + hp + "❤ " + " §a "+ def + "✸ ");
}
}, 0, 20L);
taskToCancel.put(p.getUniqueId(), taskID);
}
}
K I see the problem but I don't really know what it is
Anyone know how to loop through all classes in a package and register them as listeners?
this.getServer().getPluginManager().registerEvents(new Telekinesis(), this);
this.getServer().getPluginManager().registerEvents(new Marksman(), this);
this.getServer().getPluginManager().registerEvents(new InfernalTouch(), this);
this.getServer().getPluginManager().registerEvents(new Spring(), this);
this.getServer().getPluginManager().registerEvents(new StrayAspect(), this);
this.getServer().getPluginManager().registerEvents(new IllusionAspect(), this);
this.getServer().getPluginManager().registerEvents(new Slicing(), this);
this.getServer().getPluginManager().registerEvents(new Dexterous(), this);
this.getServer().getPluginManager().registerEvents(new Beheading(), this);
this.getServer().getPluginManager().registerEvents(new Necrotic(), this);
this.getServer().getPluginManager().registerEvents(new MagmaWalker(), this);
this.getServer().getPluginManager().registerEvents(new Tectonic(), this);
this.getServer().getPluginManager().registerEvents(new Evasion(), this);
this.getServer().getPluginManager().registerEvents(new Succession(), this);
this.getServer().getPluginManager().registerEvents(new Farmhand(), this);
this.getServer().getPluginManager().registerEvents(new FragilityCurse(), this);
this.getServer().getPluginManager().registerEvents(new Wisdom(), this);
this.getServer().getPluginManager().registerEvents(new VampireAspect(), this);
this.getServer().getPluginManager().registerEvents(new Leeching(), this);
this.getServer().getPluginManager().registerEvents(new Instability(), this);
doesn't seem like good practice
I personally register events per class
looks those are enchantments
public abstract class Enchantment implements Listener {
public Enchantment(JavaPlugin plugin) {
Bukkit.getPluginManager().registerEvents(this, plugin);
}
}
and then you can make each enchantment extends Enchantment
public class Wisdom extends Enchantment {
public Wisdown(JavaPlugin plugin){
super(plugin);
}
}