#help-development
1 messages · Page 2217 of 1
if (list.contains(block.getType()))
forgor about contains tysm
bruh
Yes
?services @primal zodiac
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
I want to create a msg plugin, but I don't know how to get the text without taking the target
/msg ANFFGaming Some Text
replace arg[1] to ""?
hi, how can i check if a player has a certain permission? Player.hasPermission checks if it has a perm contains the given parameter
ΤΥ
is it working rn?
How to add Material to list?
List<Material> blocks = List.of(Material.STONE); blocks.add(Material.Example);
[13:54:43 WARN]: An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.lang.RuntimeException: Unable to access address of buffer
at io.netty.channel.epoll.Native.read(Native Method) ~[patched_1.8.8.jar:git-PaperSpigot-445]
at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe.doReadBytes(EpollSocketChannel.java:678) [patched_1.8.8.jar:git-PaperSpigot-445]
at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe.epollInReady(EpollSocketChannel.java:714) [patched_1.8.8.jar:git-PaperSpigot-445]
at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe$3.run(EpollSocketChannel.java:755) [patched_1.8.8.jar:git-PaperSpigot-445]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380) [patched_1.8.8.jar:git-PaperSpigot-445]
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:268) [patched_1.8.8.jar:git-PaperSpigot-445]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [patched_1.8.8.jar:git-PaperSpigot-445]
at java.lang.Thread.run(Thread.java:833) [?:?]
so this is a error that is spammed in my console every time i try to connect to the server via bungeecord
its 1.8.8 server in bukkit.yml the connection throttel thing is at -1 in spigot.yml bungecord is set to true and in server.properties online mode is set to false and in the proxi its the the second in priority and ip forwarding is true and its on the correct port
its the first 1.8.8 server im releasing on to my network and for some reason this is giving me a issue however all the over servers on the network work just fine
Hey, so i again have an little problem.
(cant copy the code with correct indent, that why i send an image link)
it works but it gives out the whole log file and spams the whole chat.
what i want:
only the latest line of the log.
how would i do this?
add continue for not last line?
yea but how do i get the last line? how should java/the code know what the latest line is?
How can I calculate damage ?
player.damage() just damages the player without checking for armor points and enchantments... in 1.8
damagemodifer armor then substract it from damage value?
I am on 1.8
hi, hasPermission method returns always true if the player is OP. is there any workaround for it? or do i have to get a full list of the perms and then check for the specific perms?
default: false in plugin.yml will work?
but what if the plugin contains an integer?
keepinventory.partially.30 for example
OP will have every permission.
Maybe try to use Player#getEffectivePermissions, and loop through that.
other crappy but probably functional way that everybody will hate :
- check if he's OP
- if so Deop
- check perm
- if was opped, reop
yikes
The better solution is to organize your groups on the permission plugin and avoid use op
^^^^
Unrelated :
What would be the best way to store an itemstack as text format. I've looked a bit into serialization but i'm not sure if there's an API way of doing it or if you have to use serialization
Given i need to store EVERYTHING, so, NBT data, lore, tags like HIDE_ENCHANTMENTS, durability etc
Maybe base64?
i think it is, i'm just not too sure if its the best way
ItemStack is configuration serializable yes
then i just loop through every element in the hashmap and store it in text format?
Check if a player can build in a specific location
How to add element to List?
List<Material> test = new ArrayList<>();
test.add(Material.GRASS_BLOCK);
Code above does not work
If I have a file named "data.json" in a plugin's resource folder, would it's path be just "data.json"?
new File(plugin.getDataFolder(), "data.json")
or new File(plugin.getDataFolder() + File.separator + "data.json")
It should work... maybe new ArrayList<Material>(); instead of new ArrayList<>();
@tardy delta thank you!
😵💫
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
ofc it doesnt work, there is no add method which takes 0 params
it does not work with test.add(Material.GRASS_BLOCK) either
How would I get the block that a player has walked on from a PlayerMoveEvent?
like the block type?
get the block under the location of the players feet
player.getLocation().getRelative(BlockFace.DOWN) or smth
I created a claim system, but when I want do to disable pvp for all player except the chunk owner and op, it doesn't work
@EventHandler
public void onPvPInteract(EntityDamageEvent event){
if(event instanceof Player){
Entity player = event.getEntity();
if(player.getLocation().getBlock() != null){
Chunk chunk = player.getLocation().getBlock().getChunk();
if(ClaimSystem.isChunk(chunk)) {
UUID uuid = player.getUniqueId();
if (ClaimSystem.getBD(chunk) == true) {
if (!(ClaimSystem.getOwner(chunk, uuid).equals(player.getUniqueId()))) {
if (!(player.isOp())) {
event.setCancelled(true);
player.sendMessage("You are not allowed to break here.");
}
} else {
event.setCancelled(false);
}
}
}
}
}
}
why does it get this error? Caused by: java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap')
the value that's supposed to be returned is integer and it is in the json file
JSONParser parser = new JSONParser();
try (Reader reader = new FileReader(plugin.getDataFolder() + File.separator + "data.json")) {
JSONObject jsonObject = (JSONObject) parser.parse(reader);
return (int) jsonObject.get(key);
} catch (IOException e) {
e.printStackTrace();
} catch (ParseException e) {
throw new RuntimeException(e);
}
return -1;
}```
cast it to a long and then to an int idk lol
what is this devilish creature
i found the solution, and it is waaaaaaaaaaaaaaaaayyyyyy easier than what i was looking into
YamlConfiguration has a .getItemstack(String) method, and you can also .set(Itemstack). Just let it handle everything
hey can anyone tell me which method will be good to increase difficulty of game?
If someone use this command /easymode then less mob should spawn and all code for this function will go to this method :- ```java
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(command.getName().equalsIgnoreCase("easymode")) {
if (sender instanceof Player) {
- - - code - - -
}
}
or should i make new class or new method for this? and then call it from this method?
declaration: package: org.bukkit, interface: World
btw thanks for this i will use this somewhere :)
¯_(ツ)_/¯
player.getInventory().addItem(a);
not work, i use java11 and server spigot 1.12.2. gives me player in red
variables
show your code + error :)
instance of Player
there is no player variable
?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.
error:
java: cannot find symbol
symbol: variable player
location: class me.gabryosas.commandi.AsciaVDF
^^
we just told you
ok
idk if this is the right channel for that, but am I allowed to Upload Paper Plugins to Spigotmc.org?
yes
wait
okay, thank you
if it doesnt use paper only api, yes
and where do I upload it if there are paper only things?
without github...
paper site
i think paper has hangar
okay...
hangar isn't really a thing yet however
you can just make a spigot port
I think you can also just upload them to bukkitdev, they do not care about the difference anymoree
if and only if it can run on spigot as well
how do I check if a raid was finished because the players won and not because the player's lost with RaidFinishEvent?
because RaidStopEvent isn't executed when the raid is won
How I can disable create end portal like this?
check the result
and before complaining that you dont know what those enum constants mean check the docs
there is no result in raidFinish.
i tried to use result in raidStop but the entire event is only executed when the players lose for any reason
i have
declaration: package: org.bukkit.event.raid, class: RaidFinishEvent
i tried to use result in raidStop but the entire event is only executed when the players lose for any reason
i know what is says i just read it
i checked and it isn't executed when it's won
i did the same check one time winning and one time losing and nothing happened when i won
it should lol, did you register it?
yes
.
Have you also checked the Raid Stop Event?
I have this @EventHandler public void Hero(RaidStopEvent event) { Player ytg667 = Bukkit.getPlayer("YTG667"); ytg667.sendMessage(event.getRaid().getLocation().toString());
when i win nothing is printed. when i lose it's printed
method names should start with a lowercase character.. again...
why does it matter
because conventions
you also hardcoded the player
Makes it easier for everyone else to read your code
it would throw anyways otherwise
a Capital letter indicates that is a Class not a method
i only did it to print to the player
its for debugging
I would assume RaidFinishEvent would fire fora win only
RaidStopEvent seems like it would fire if the raid was lost
actually RaidStopEvent would fire always
the docs say that it executed whenever a raid id done whether is was won or lost
RaidEvent got a getRaid() method. Raid got getHeroes method which returns Set<UUID>
It is only triggering for command argument tab completing, not the actual command itself tab completion.
there is a Raid.RaidStatus enum with LOSS, ONGOING, STOPPED, VICTORY
both RaidStopEvent and RaidFinishEvent inherit from RaidEvent
TabCompleteEvent is only for args on commands
RaidFinishEvent is for VICTORY
cause there is a getWinners() method which returns a List of Player
oh ok thx
Unless it is console?
Command TabComplete is done from the CommandMap
Note that due to client changes, if the sender is a Player, this event will only begin to fire once command arguments are specified, not commands themselves. Plugins wishing to remove commands from tab completion are advised to ensure the client does not have permission for the relevant commands, or use PlayerCommandSendEvent.```
Yep, no permission it won;t be in their command list
Hello, anyone can help mi with that? I want to change every link sended by player in chat change to my link, i know, i need to to that with AsyncPlayerChatEvent and regex but i don't have idea how (and i mean replacing by converting url to another based on url so example: String originalurl = ""; byte[] enc = originalurl.getBytes(); String encoded = Base64.getEncoder().encodeToString(enc); String replacedurl = "https://nonexist.nonexist/something.php?=" + encoded + "";
i already founded exactly that and didn't helped me
It literally gives you the regex to find ANY url and replace it
what?
you have an incoming String in teh getMessage(). Perform replaceAll with that regex
yes but how exactly replace every url with new converted url?
you readed my example to convert?
String regex = "(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
//in Event
event.setMessage(event.getMessage().replaceAll(regex, "http://yoururl.com"));```
i know about that
problem is detection original url
because that must be converted
for understanfing: player in chat send message with example: https://www.youtube.com and i need that url replaced by my url but original player url must be converted to base64
why muist it be converted?
url that player sended
because of web api
I don;t understand what Base64 encoding has to do with anything
Its easier to send data in Base64 than in binary form
ok, lets start over. You asked how to replace all player entered web links with yours.
yes but every that link must be separatelly converted
why?
because of web api
web api has nothign to do with player chat
yes, it has, because of ad link
I'd suggest you go reformat your question as you are only giving broken pieces of it.
my english isn't perfect, that is true
web api and ad link are nothing to do with your original question
so converted chat link -> my web -> linkvertise -> final target link
Are you wanting to do something with the web links that the player has entered?
that's the point, replacing original links
Then compile a Pattern from the regex and you can process each match
i know, i need to do that but I'm really bad in regex
yes
https://www.tutorialspoint.com/java/java_regular_expressions.htm Scroll down to the section that has while(m.find())
i don't understand that regex, I'm literally self-learned but regex is not my part ....i tried exactly use that ..... don't worked
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
yes regex is well... interesting to say the very least
anyway you probably wanna cache the regex
since that'd compile it every time you invoke it
I'm tried to that and don't worked ... I'm literally don't understand regex
oh... i can't send image
i didnt know you could make projectiles bounce lmfao
verify
ye if you have to compile it every time
Not tested, but somethign like ```java
Pattern patern = Pattern.compile("(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~|!:,.;]*[-a-zA-Z0-9+&@#/%=~|]");
public void findURL(String message) {
Matcher match = patern.matcher(message);
int count = 0;
while (match.find()) {
System.out.println("Found: " + match.group(count));
count++;
}
}```
why getting the bytes of a stringbuffer.toString?
dont even know what a stringbuffer is lol
^they're badly optimized due to "antique" thread safety
But in this case the allocation is superfluous as you'd really want to call String#getBytes
you dont have to. if you've made nothing wrong you'll never need it
StringBuilders on the other hand are the best shit out there
where i can find list of minecraft sounds with preview
?bing
Bing your question before asking it:
https://www.bing.com/
That used to internally create a StringBuilder
yeah well basically StringBuffer with no obsolete synchronization
JIT probably optimises a fair bit there, but using a shared StringBuilder instance is rather neat
IntrinsicCandidate ;**
Is it possible to set a Entity's bounding box?
so like they can only walk inside that area?
That is a very strange definition of bounding box
lmfao Im not exactly sure how to even use it so
Or at least not the traditional connection
well
It is the right term, yes
what are you trying to do
call it a region (BoundingBox) 🙂
Im trying to allow mobs to only walk within a certain area of their spawn
ohh i thought of a hitbox
Ive done that recently. I set a bounding box and check whether that bounding box contains the entities bounding box, if not i tp them back inside
And this is why I said that
What event would I even call that in?
I made my own
I disabled door opening with this :
block.getState().getData() instanceof Openable
But still can open Crimson and Warped doors
every second I go through the entities Ive assigned a bounding box to and check
every second 😳
wouldn'
You can spread out the workload across multiple ticks anyways
yeah
i liked this post https://www.spigotmc.org/threads/guide-on-workload-distribution-or-how-to-handle-heavy-splittable-tasks.409003/
you could yeah. for my purposes its not necessary tho. at least not for the targetted servers
hmm okay
that bounding box contains the entities bounding box
Could you explain this to me? @crimson terrace
BoundingBox#contains(BoundingBox boundingBox)
Uhuh
any problem?
OHHH
you have to make another bounding box and check whether the zombies box is inside the big one
So I should make a bounding box that get init'd onenable for their allowed locations
ye
Player player = (Player) sender;
ItemStack ascia = new ItemStack(Material.IRON_AXE, 1);
ItemMeta ascianame = ascia.getItemMeta();
ascianame.setDisplayName("§cAscia VDF");
ascia.setItemMeta(ascianame);
ascia.addEnchantment(Enchantment.DURABILITY, 1);
player.getInventory().addItem(ascia);
player.sendMessage("§7[§cVDF CORE§7] §7Ascia givvata con successo!");
give me a stone axe don't axe iron, how can I solve?
doesnt make sense
It would probably be cheaper to just set a tether range
have you restarted your server with the new plugin?
yes
java naming conventions, Let's learn what is naming convention and what are its benefits.
the code you sent gives you an iron axe, the problem must lie somewhere else
did you have it as a stone axe before?
yes
hit ctrl shift F and search for "STONE_AXE"
ok
if there is none, build the project again and put the new jar file back into the server, then restart it
There is not
What do you think is better to use, CompletableFuture.runAsync or Bukkit.getScheduler().runTaskAsynchronously and why? Been thinking about what to use, as i'm not sure if the Bukkit Scheduler works the same as CompletableFuture.. Does it? 😄
Doesn’t really matter if you supply the cf with a good executor
In java 19 the runAsync will be better in combination with virtual threads
I just plan to fill my cache with data from mysql with it.
Since runTaskAsync probably will stay as is with the cached thread pool
hey guys, i wanna do smth like
- every 24 hours, X player's progress resets
- which contains
- all the blocks they placed turning into the block that was previously there
- there items be gone (i know how to do this)
now how do i store all blocks placed by the player effeciently
as this could get messy with like 50 players
Im stupid... There was a script with the same command, that's why it didn't go
why not just replace the world every 24 hours?
How far could the players move?
cuz that also resets other player progress
Then store changes in a database
sqlite would be fine for 50 players
no but the problem is also resetting
why?
cuz imagine i m resetting for 10 players, all of them have like 200 blocks
and now all of a sudden i m replacing so many blocks
wont that make the server a bit slow?
at that time no one will be online if that helps
It gets messy if you allow players to move more than 2^27 blocks in either location, otherwise you can just do a Map<Player, Map<Long, OldBlock>>
whats the long for
Also, why do I store the loc when OldBlock already has a way to get location?
If you are on paper you might be able to pass it through DFU
What happens if a non-reset player interacts with a block scheduled to be reset?
it just stays how the non reset player decided to
Prevent collisions
will remove it from the db
can u elaborate please
what data do you think will get reset? 😄 you won't clear players inventories if you delete the world
Well if you player sets a block twice at a certain position and this thing
yea i m not deleting the world
okay
Oh yeah, and your idea does open up the window for dupes
don't work 😅
what do you mean it don't work?
registered it?
I imported spigot remapped to mojang nms into my project and I get this error right here: java.lang.NoClassDefFoundError: net/minecraft/nbt/Tag, I tried using both reobfuscated and not reobfucated in the server.
I have checked that both the server and the plugin use the same nms version
Has anyone here used sparked host
#help-server i guess
@dusty herald I ask question in this place
and PortalCreateEvent don't work on this portal 😅
using Maven/Gradle?
Gradle
smth changed and now I get java.lang.ClassNotFoundException: qc instead
yes sir
Player player = (Player) sender;
ItemStack stivale = new ItemStack(Material.LEATHER_BOOTS);
ItemMeta stivalename = stivale.getItemMeta();
LeatherArmorMeta o = (LeatherArmorMeta)stivale.getItemMeta();
o.setColor(Color.RED);
stivale.setItemMeta(o);
stivalename.setDisplayName("§cStivale VDF");
player.getInventory().addItem(stivale);
not work displayname
u arent setting the item meta back
could anyone write a plugin for me that sets the item in the 9th hotbarslot to item{CustomModelData: 11112222} with 1111 being (x-location of the player+6000)/10 and 2222 being the (z-location of the player+6000)/10 , (doesnt really matter what the item is
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
we dont write stuff for you, u can find devs here tho ^
I am switching again and again from mvn to gradle and from gradle to mvn 😭 I am using commandline to reobfuscate it
Player player = (Player) sender;
ItemStack stivale = new ItemStack(Material.LEATHER_BOOTS);
ItemMeta stivalename = stivale.getItemMeta();
LeatherArmorMeta o = (LeatherArmorMeta)stivale.getItemMeta();
stivalename.setDisplayName("§cStivale VDF");
o.setColor(Color.RED);
stivale.setItemMeta(stivalename);
stivale.setItemMeta(o);
player.getInventory().addItem(stivale);
this?
LeatherArmorMeta o = (LeatherArmorMeta)stivale.getItemMeta();
yes
you already made a variable for the meta
yea i dont understand why u are using two metas
This is probably the best tutorial on using NMS with Maven https://blog.jeff-media.com/nms-use-mojang-mappings-for-your-spigot-plugins/
Someone has a good vector tutorial?
so i have arraylist of player:number. how can i sort highest to lowest
Is it possible to render the nametag of a entity without the black backdrop?
Or generally, display text without a background
n o
Weirdly agressive answer, but alright
i thought someone made that already and had public it?
First time using PlayerInteractEvent, how do I prevent this crash error?
at net.minecraft.world.item.ItemStack.P(ItemStack.java:194) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at net.minecraft.world.item.ItemStack.e(ItemStack.java:1190) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at net.minecraft.server.level.PlayerInteractManager.a(PlayerInteractManager.java:453) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1655) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:32) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:31) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at net.minecraft.util.thread.IAsyncTaskHandler.d(SourceFile:157) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(SourceFile:23) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1150) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:1) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at net.minecraft.util.thread.IAsyncTaskHandler.x(SourceFile:131) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at net.minecraft.server.MinecraftServer.bh(MinecraftServer.java:1129) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1122) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at net.minecraft.util.thread.IAsyncTaskHandler.bq(SourceFile:116) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1105) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:1014) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:291) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3528-Spigot-56be6a8-031eaad]
at java.lang.Thread.run(Thread.java:833) [?:?]```
new Thread(() -> Bukkit.getScheduler().runTaskTimer(Tazpvp.this, MobUtils::everySec, 20, 20)).start(); 🤓 thread
im pretty sure getList doesnt return a list of locations
probably a list of objects
How does Armor Wear Event spigot work?
?javadoc
triggers whenever armour is equipped
There is no Armor wear event in Spigot
I hope he means equip
Theres no wear or equip event in Spigot
Where can I look for a code to take an example?
Not in Spigot
the full error
thats not the full error
thats just the stack trace
should say something ending with Exception
Here is what it returns:
[Location{world=CraftWorld{name=world},x=1.0,y=119.0,z=0.0,pitch=0.0,yaw=0.0}, Location{world=CraftWorld{name=world},x=0.0,y=119.0,z=0.0,pitch=0.0,yaw=0.0}, Location{world=CraftWorld{name=world},x=-1.0,y=119.0,z=0.0,pitch=0.0,yaw=0.0}]
is 3.4ghz and 3.7ghz turbo good for a minecraft server?
Better question, what angles do I have to set the head pose of a armorstand to so that the angle is isometric when looked at from dead-center front
[11:41:30] [Server thread/ERROR]: Encountered an unexpected exception
That plus the thing in the link is literally the only things related to the error in the logs.
looks like ur server is broken
update the jar?
if this isnt about your own plugin then go to #help-server
It is.
nvm
int diff = mobCap - entities.size();
if (diff <= 0) return;
int spawnAmount = (int) (Math.random() * (mobCap + 1)), count = 0;
while (count <= spawnAmount) {
count++;
int ranX = getRandomWithNeg(size), ranZ = getRandomWithNeg(size);
Block block = world.getHighestBlockAt(ranX, ranZ);
Location loc = block.getLocation().clone().add(0, 1, 0);
entities.add(world.spawnEntity(loc, EntityType.ZOMBIE));
}
}
}.runTaskTimer(this, 0L, spawnTime);
}
second line , forth line and run.TaskTimer(this, 0L, spawnTime) are coming back wrong
also it says that the last 2 curly brackets need a ;
Is there a way to get sheep's color
is 40gb ssd enough for a server
giggabytes or gbp
yea
if thats all u got on it
just the server
like for plugins too
yup
fair
u need more space
but like an smp will take up 10-25gb at a streach
https://paste.gg/p/anonymous/68f1d30d94684131abbfaeb9a6090e90
anyone know this error
int diff = mobCap - entities.size();
if (diff <= 0) return;
int spawnAmount = (int) (Math.random() * (mobCap + 1)), count = 0;
while (count <= spawnAmount) {
count++;
int ranX = getRandomWithNeg(size), ranZ = getRandomWithNeg(size);
Block block = world.getHighestBlockAt(ranX, ranZ);
Location loc = block.getLocation().clone().add(0, 1, 0);
entities.add(world.spawnEntity(loc, EntityType.ZOMBIE));
}
}
}.runTaskTimer(this, 0L, spawnTime);
}
second line , forth line and run.TaskTimer(this, 0L, spawnTime) are coming back wrong
also it says that the last 2 curly brackets need a ;
Can anyone help me with converting (HEX from config) String #f15c31 to Bukkit Color for example to use it on Armor or Fireworks?
Hi.
I'm trying to store a list of locations and I've used a File to store the data between server restarts. but im having some trouble retrieving and storing the list to a variable. I know that im retrieving the List correctly but when im trying to make it to the variable it breaks.
What ive tried:
public static List<org.bukkit.Location> DrillLocations = new ArrayList<>(); DrillLocations.addAll(FileHandeler.getFile().getList("Cords"));
And:
public static List<org.bukkit.Location> DrillLocations = FileHandeler.getFile().getList("Cords");
Use the md5 Color import then ChatColor.of
Hi guys its possible autogenerate a yml on bungee?
i have added config.yml on resoruces but don't create it
And this create lang.yml in plugins folder
file = new File(ProxyServer.getInstance().getPluginsFolder() + "/lang.yml");
Is there any way to make a nametag smaller?
By giving it to a different entity or something?
Hey, I keep getting a null error for my event listener, and I can't figure out why.
this is me registering the event
Any thoughts?
i’d register events in the main class..
Show us the actual error
Where are you instancing the PlayerKits Class?
your instance you pass is null
why not pass this?
must abuse static
right
how do i use an instanceof in a foreach/predicate
entity -> entity instanceof Player
doesnt work so idk
those are called lambda's fyi
well what ru tryna do
this
that should work fine
List<Entity> list = ...;
List<Entity> players = list.stream().filter((ent) -> ent instanceof Player).toList();
for example
this works fine
you could also map it to List<Player>
yea you could
how dare you use a smiley face the wrong way arround!
Let me see
how?
anyone know how to set the color of some leather pants
that returns a Stream of player, how do i conver thtat to a collection/list
.toList()
yea
#toList returns an unmodifiable list
hello i want to spawn a ender dragon in overworld but it has to support changing phases and having a portal how to do that
1.17.1
uhh as far as i know enderdragons AI is disabled in overworld
ignore the line at the top, its a duplicate method error
so would prolly take some trickery to get arround that
The last time I spawned a dragon in the Overworld it always heads off to 0,0. But that was back in 1.7 days
I'm trying to parse an Item from an arg on a command, but I get null exception. java try { ItemStack item = new ItemStack(Material.getMaterial(args[1].toUpperCase()), Integer.parseInt(args[2])); } catch (NumberFormatException e) { player.sendMessage(ChatColor.RED + "The item " + args[1].toUpperCase() + "doesn't exist"); }
args[1] isn't null, I can print it
uh
No but getMaterial can return null iirc
Returns:
Material if found, or null
yeah but it doens't send the message to the player
Anyway you should favor matchMaterial
and the action you take after an exception is wrong too
It’s much kinder
ok let me try
you send them a message the item doesnt exist
while really they didnt enter a correct number
Yes because the NPE terminates the execution
anyone know how to set the color of some leather pants
use LeatherArmorMeta
try Material.valueOf(args[1])
👍
marerial
Don’t
matchMaterial
That’ll just explode upon misinput
Attempts to match the Material with the given name.
This is a match lookup; names will be converted to uppercase, then stripped of special characters in an attempt to format it like the enum.
that also throws a null exception
Literally not
make the player input a number and choose a material from the ordinal 😄
ItemStack(null) throws NPE
Because it doesn’t make sense for the material of said stack to be null
i know
Material.valueOf(args[1].toUpperCase())
mk
no
Stop
oh that's maybe why
Yes
You should cache matchMaterial into a variable, null check the value of the variable and if not null then continue
?
Yes
i tried \d and it doesn't work
\d means digit
like 0-9
alright
Since you need to escape the escape character
actually thats not entirely correct
Yes
[0-9] will match 0 to 9 as it sais, \d will match any number so also latin numbers and stuff
Latin numbers?
I, II, III, IV etc
idk there are weird numbers
those will be matched by \d as well
unless im stupid
or i am confused with \w
whats latin numbers
XD
is there a difference
No
ok
They’re equivalent
in \w there is a difference tho
Ye
between \w and [a-zA-Z]
[A-Za-z]
\w is like [a-zA-Z0-9]
thx
arabic characters only or like chinese and hindi and everything as well
Like \p{IsLatin} or sth
pretty sure everything
Does ChatColor#of() translate colorcodes like & and hex values?
o
btw whats the _ for
some methods i made to find players, any way to improve or nope
By convention you should use Predicate<? super Player> such that an instance of Predicate<HumanEntity> could be passed
But looks fine
I would avoid streams
okay
why?
Since they’re not yet competitive with normal loops
was suggested to me by 7smile
And those methods look like they would be executed arbitrarily during runtime post bootstrap
streams are really useful
So are loops
but ugly
You don’t use lambdas cause they’re hot tho
well yes
No
well no
I do wdym
lmao
You’d use them because they tend to abstract or avoid side effects
- they're hot
^
literally doesn’t matter
¯_(ツ)_/¯
i use streams cause they make a huge multi step problem a one line issue
Streams as of now scale significantly worse than loops
Well if you wanna be clean just extract a method with the loop like any clean coder would do
by smile's logic, 1 line = faster 😄
they are slower but i accept that
yez :D
same, but depends on the use case
My guess is that in this case the performance difference of streams and loops isn't going to matter.
Yea for bootstrapping and termination it’s fine to use streams
But they really suck ass right now when it comes to performance since it has to switch on the terminal operation type and sometimes can’t evaluate lazily
whats the actual speed difference
but pls use good java benchmarks
But it’s a bit hard to bench mark individual methods as sometimes they’re lazily evaluated
use org.openjdk.jmh
Anyway light fury thats what I would say, go with a loop, or at least get rid of the stream, you can create some hacky for each higher order function if you want to
if you’re in love with javas lambda syntax ig
but the performance difference between forloop and streams are not that high
in some critical systems every little bit counts though
but makes code less readable
Like, streams are worse in terms of both space and time
No it doesn’t
It reduces boilerplate tho
But that’s different
can someone explain what this does exactly? i'm not sure if my understanding of this line matches to what the docs mean https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryAction.html#PLACE_ALL
declaration: package: org.bukkit.event.inventory, enum: InventoryAction
because my code isn't working the way i think it's supposed to work
In an InventoryClickEvent this would be the InventoryAction if you were putting a stack into a slot.
so with this code, it should message the console whenever i place a wooden axe in my inventory, right?
no, you never check what the type of the item is
is getVersion() and getBukkitVersion() the same?
no
ok i've done some testing, with this code, the message pops up both whenever i place everything from my cursor down in my inventory and when i pick it up, which makes no sense
does anyone know why?
Version = plugin Version
BukkitVersion = server Version
wrong
Mb
and the console doesn't say anything at all with this code even after i tried clicking on a stack of items, one item, etc in my inventory
is there a reason for this?
Anybody know what has happened to EpicWorldGenerator, is it still supported?
no
the author hasn't cared about ewg for 2 years
it's in inactiveresource
you can't purchase it
terra, realisticworldgenerator, iris
Respec. Thanks man those are free resources and not only that they look substantially better than EWG.
terra is very good i can confirm 😏
Dude the .jar name is incredibly long.
It looks sorta scuffed.
But I know it's safe.
ok
ok
Since nobody else would help me with my server. Would you?
Hey guys, I am having some trouble with the getLineOfSight function. I want to only get water SOURCE blocks, but it takes a material list for its "transparent blocks". Well, water is no longer differentiated by the two material types WATER and STATIONARY_WATER, I have to use a Levelled block instance. How can I approach this? My getLineOfSight is returning flowing water blocks, when I want it to look through them =[
I'm guessing the only option here might be to use a Raycast with a predicate to filter out the non-source blocks? Would like to stick with getLineOfSight if possible though for simplicity
Oh 😮
looks like raycast blocks has a FluidCollisionMode option, can take SOURCE_ONLY 😉
How to get if player is holding A/D key?
dont think you can get what keys the player is holding
you can tell that they are sneaking or sprinting, thus kinda getting ctrl and shift, im not 100% though there might be a way
i thought of MoveEvent
but that can lag the crap out of the server..
Does anybody know a good ScoreboardApi?
Define good
Hello guys, I've a question for you. How can I get all the id’s and their relative values in the "Values" column in the form of hashmap<Integer, String> in mysql? Thank you for everything you'll do 🙂
Which can be used for viewer specified events such as Duels
Anyone have an idea on the hollow blocks?
Falling ?
he said hollow falling blocks
I'm looking for a plugin that won't allow me to pick up creative from articles, help me pls
what is articles
and 'pick up creative'
and this also isnt the right channel
hey is there any good way to shorten/clean this up?
Hi.
I'm trying to store a list of locations and I've used a File to store the data between server restarts. but im having some trouble retrieving and storing the list to a variable. I know that im retrieving the List correctly but when im trying to make it to the variable it breaks.
What ive tried:
public static List<org.bukkit.Location> DrillLocations = new ArrayList<>(); DrillLocations.addAll(FileHandeler.getFile().getList("Cords"));
And:
public static List<org.bukkit.Location> DrillLocations = FileHandeler.getFile().getList("Cords");
yaml:
`Cords:
- ==: org.bukkit.Location
world: world
x: 1.0
y: 119.0
z: 0.0
pitch: 0.0
yaw: 0.0 - ==: org.bukkit.Location
world: world
x: 0.0
y: 119.0
z: 0.0
pitch: 0.0
yaw: 0.0 - ==: org.bukkit.Location
world: world
x: -1.0
y: 119.0
z: 0.0
pitch: 0.0
yaw: 0.0
Test: - Hello
- World
LoremIpsum: Test
`
yes i tried printing it with toString() and it worked
don't you need to deserialize
what does that mean?
im new to java
DrillLocations is a ArrayList of org.bukkit.Location
DrillLocations.add(event.getBlock().getLocation()); FileHandeler.getFile().addDefault("Cords", DrillLocations);
This should 100% not be a switch statement but a map
Either <String, String> or if you want to use the calls instead <String, Supplier<String>>
and just have a getter
those values change though,
how often do i update this map
runnable async?
Data structures like lists, sets and maps should never have getters or setters. This breaks strong encapsulation and leads to very messy code.
i meant map.get not an actual getter method sorry
aye guys, im marking an entity for removal with Entity.remove(), but afterwards it leaves a ghost of the entity that stands in place and whos collision box still affects the player
You simply create the map once and fill it. You can have something similar to a method in a Map. Ill give you and example.
disconnecting and reconnecting removes it, is this a known thing?
yeah but values update
The value is a method. You never update it.
do you mean putting the BukkitUtils.methodHere() inside the map?
but wont htat be equivalent to putting an actual value in the map
How to get direction that player moved in?
uh?
still don't understand
i'd appreciate some kind of example if you can
private final Map<String, Supplier<String>> placeholderMap = new HashMap<>() {{
this.put(SERVER + "version", () -> BukkitUtils.getServerVersion());
this.put(SERVER + "version_tab", () -> BukkitUtils.getVersion());
this.put(SERVER + "name", () -> BukkitUtils.getServerName());
...
}};
public String onPlaceholderRequest(Player player, String placeholder) {
if(player == null) {
return null;
}
return placeholderMap.getOrDefault(placeholder, () -> null).get();
}
oh i see
so not putting the actual method, putting the value of the method at the time
of getting the value
Or to be more clear on what is happening:
public String onPlaceholderRequest(Player player, String placeholder) {
if(player == null) {
return null;
}
Supplier<String> supplier = placeholderMap.getOrDefault(placeholder, () -> null);
return supplier.get();
}
2 ways.
PlayerMoveEvent -> Build a vector from "from" to "to"
Player -> get his velocity
Nope.
Yeah the map should be invisible to anyone else unless you want to let others register placeholders as well.
So putt it in the class that also contains the method.
Is there an easy way to get the direction a player is looking at, and get the oposite of it?
Only yaw
Sure.
public Vector getBackwards(Player player) {
return player.getEyeLocation().getDirection().multiply(-1);
}
Thats the vector. You can figure out the yaw from there.
or no
Sure you can also use method references.
But that only signs it negatively
-45 is not the oposite of 45
private final MessageService messageService = new MessageService();
private final Map<String, Supplier<String>> placeholderMap = new HashMap<>() {{
this.put(SERVER + "version", () -> BukkitUtils.getServerVersion());
this.put(SERVER + "version_tab", () -> BukkitUtils.getVersion());
this.put(SERVER + "name", () -> BukkitUtils.getServerName());
this.put("coolname", this::getCoolName);
this.put("msg", msgService::getMessage);
...
}};
public String onPlaceholderRequest(Player player, String placeholder) {
if(player == null) {
return null;
}
Supplier<String> supplier = placeholderMap.getOrDefault(placeholder, () -> null);
return supplier.get();
}
private String getCoolName() {
return "Bob";
}
There you go. One local method reference and one from another class instance.
scalars
neat, thanks
This gives you the exact opposite vector of the players eye direction.
i love the alt key 😍
For just the yaw. Not sure if it works.
public float getBackwardsYaw(Player player) {
float currentYaw = player.getEyeLocation().getYaw();
return (currentYaw + 180F) % 360;
}
The plan is faily simple
Vector invertedView = player.getEyeLocation().getDirection().multiply(-1);
float yaw = (float)Math.atan2(invertedView.getX(), invertedView.getZ());
if(data.dirLocked()) {
// Snap to a cardinal direction
} else {
// Set rotation to face the player
}```
Snapping is the issue though, idk if I can use the minecraft direction implementation which I know for a fact can go off of an angle
snapping?
How to create a paginated help menu like /help 1/2/3...? With 10 obj for each page?
dynamic locations should fix yaw and pitch stuff
anybody got any idea why when I mark an entity with .remove(), it glitches client side and creates a frozen copy of the entity? reconnecting fixes it
remove it with a packet ? idk much about packets tho
you could send it to the player after
removing it serverside
hmm, it seems weird that is even necessary when there is that remove function o.o
figure it would handle sending those packets
yeah as i said im not sure, ill check gimme a sec
Is there any 'right way' when it comes to making GUIs. I feel like I always make it overcomplicated and really messy.
how to use 1.19 nms?
java.lang.NoSuchMethodException: net.minecraft.network.chat.ChatMessageType
Yes. Delegation is key.
https://www.spigotmc.org/threads/spigot-bungeecord-1-19.559742/
Scroll down to "NMS"
Since 1.17 nms works differently
essentialsx uses the default e.remove()
and that works fine, what does your code look like
Meaning you should have a Consumer<InventoryClickEvent> or something similar somewhere in your pipeline.
hmm so they do, ill post a snippet here RQ
then again essentials is a big project so they might have some handler elsewhere that manages that
It does. When you call .remove() on an entity then it will be removed like when it would despawn.
@EventHandler
public static void BucketEntityEvent(PlayerBucketEntityEvent event) {
ItemStack original = event.getOriginalBucket();
if(ItemManager.isBetterBucket(original.getItemMeta())) {
if(ItemManager.interactableEntities.contains(event.getEntity().getType())) {
original.setItemMeta(ItemManager.setContentType(original.getItemMeta(), ContentType.valueOf(event.getEntity().getType().name())));
ItemManager.updateItemStack(original);
event.getEntity().remove();
// TODO: Should not just set main hand
event.getPlayer().getInventory().setItemInMainHand(original);
}
event.setCancelled(true);
}
}
cleaned it up a bit for ya
you can see I am cancelling the event, and removing the relevant entity
but the remove leaves a "ghost" client side, reconnecting fixes it though
Remove the entity one tick later
ohhhh interesting idea 😮
not quite sure how to do that atm, will do some googling 😄
bukkit runnable
?scheduling
runTaskLater
ayee thanks you guys, gonna try this will update with results
Bukkit.getScheduler().runTaskLater(yourPlugin, () -> event.getEntity().remove(), 1L);
what if im using grade?
!spigotmain: Could not find org.spigotmc
1.19-R0.1-SNAPSHOT.
Required by:
project :spigot
?bt You still need to run BuildTools
Tricky. You need to do some research because the special sources plugin is maven only iirc.
For gradle projects i just used the userdev plugin from Paper 😅
yo 7sm how would i put this in the map?
should i just keep that in the placeholderrequest
try the first one and if thats null try this else return params
I think that would be the best sollution
does anyone know the range of horse speed, jump strength, and max health possible
like the natural range when spawning in
Horse's movement speed ranges from 0.1125–0.3375 in internal units, with an average of 0.225.
@sacred mountain @lost matrix it worked! delaying by 1 tick made the ghosting effect go away, you guys rock
that was the biggest bug preventing me from finishing up this plugin for our server =] thanks a bunch
ive seen this online but i didn't believe it.. I tried out 0.1125 and i have never in my life seen a horse so slow
to the point where you can sprint faster than it
unless you put the horse on drugs
i also saw jump strength is 0.4-1.0, but at 1.0 the horse can jump 5.25 blocks and I also have never seen that before
welp i was just checking then
ok one final question 😉
okay
is there a way to get the center of a block from the Location object? I want to spawn an entity in the center of a block rather than right on the corner
I could just add .5 to each, but figure there might be a function already
pretty sure you just have to do Location#getBlockX() + 0.5
block.getLocation().add(.5, .5, .5) 😉
ye that works
one last thing, would it be better to store the object in the supplier instead of just the string? then i can do other things if needed
i dont like people who dont put a 0 before the decimal point
playerfishevent?
or no
Maybe add 1 to the y depending
declaration: package: org.bukkit.event.player, class: PlayerFishEvent
ohh yeah thats a good point, since spawning on TOP of blocks will need a full Y
() -> null is just getting the value, else return null right?
placeholderMap.getOrDefault(params, () -> null).get()
Or u may need to add 0
Again depending
If the block is air add 0 if it's solid add 1
why getOrDefault(key, null), thats the default implementation for get(key)
story of my time learning to dev for spigot haha, always another very specific scenario you have to account for if you overriding normal game behavior through event cancels
having to cancel all the regular bucket interact events because they replace the item meta, so doing all this bucket logic in the interact events
Hi, I'm new to packets and I'm trying to use the entity move packet
If I understood correctly, using ProtoclLib it should be the PacketType.Play.Client.POSITION
How do I get the information about it though? like what variables can I get out of it (I'm asking where can I find this on google)
ask 7smil
i didnt write htat
there's got to be a better way of doing this
ok
Can texts not escape UTF characters?
I am trying to set ▮ into a motd
And it just corrupts it
I can set it through code though
Also, different question
How do I rotate a armorstand, as in the entity itself?
Just setting y rot and x rot does nothing
you need to telelport it to the same location, changed direction
i think location has the direction builtin so you just need to do armorStand.teleport(updatedLocationWithDirection)
I have set the rotation before spawning the entity though
I need help, when I did sudo apt install openjdk-14-jre-headless I got this error: 'openjdk-14-jre-headless' has no installation candidate
iirc you need to use radians
Math.toRadians(yourDegreesHere)
EulerAngle(Math.toRadians(yourDegreesHere) , yDegrees , zDegrees)
?protocol
anyone know why that happened? I'm using ubuntu
this isnt hte place to ask
Nope, that is still not it
did you use
armorStand.setHeadPose(new EulerAngle(Math.toRadians(blah), y, z))
setRotation?
Well u need to use yaw or pitch
i think they already did that
A nms armorstand has no setrotation function
just a set yrot and setxrot
Which I am using
it inhertis the entity class tho
its also in the javadoc
oh nms
the bukkit api has stuff tho
I am using a nms entity to fake packets
Can't really do that with bukkit entities unless I cast like 3 times in the process
why woukd yioyu need to cast 3 times
i am very confused... if (land.getOwnerUID() != p.getUniqueId()) { Bukkit.broadcastMessage("owner " + land.getOwnerUID() + " player " + p.getUniqueId()); p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&7You do not own this claim")); i need to make a thing that checks if land.getowner and p.getunique are different but this ALWAYS triggers which makes no sense because when i broadcast the 2 they are the exact same so why is this happening
Because a lot of things I am accessing are not abstracted by bukkit
Or however you call it
Objects.equals(a,b)
So I would need to go between a craftbukkit and nms entity constantly
ah ight ty
Guys, please help.
How can I close these two PreparedStatment and ResultSet?
public HashMap<Integer, String> getValues() {
try {
PreparedStatement ps = plugin.getMySQL().getConnection().prepareStatement("SELECT * FROM agencies");
ResultSet rs = ps.executeQuery();
HashMap<Integer, String> values = new HashMap<>();
while (rs.next()) {
values.put(rs.getInt("ID"), rs.getString("AgencyName"));
}
return values;
} catch (SQLException e) {
if(e == e.getNextException())
return null;
e.printStackTrace();
}
return null;
}```
!= is only appropriate when comparing primitives and enums, but not much more unless you know what you are doing
or instances
Player whoToTarget = player.getServer().getPlayerExact(ChatColor.stripColor(event.getCurrentItem().getItemMeta().getDisplayName()));
How would I access whoToTarget from else if statement under
This also applies to wrapper classes, Integer.valueOf(5926) == Integer.valueOf(5926) will return false for example
define it above
Player whoToTarget;
if() {
//
} else //
i forgot the word for it
theres like instantiation, assignment and seomthing
declaration?
or was the first one initialization
Elgar, help pls
try (PreparedStatement ps = plugin.getMySQL().getConnection().prepareStatement("SELECT * FROM agencies")) {```
and then I close it in a finally right? Thanks!! I hadn’t thought about it!
PreparedStatement is AutoCloseable
ah
no, that will close it when its finished
Object o; // Declaration
new Object(); // Instantiation
o = x; // Assignment
yez
A friend of mine told me that it is better to close things when talking about actions that interact with the outside (in this case with the database) because the GC does not insure the outside in fact
I didn’t know, thank you so much again Elgar! You’re giving me a great helping hand in learning mysql & java!
in a try with resources once you exit the scope of the try it will auto close anything in the try (...)
I understand, thanks thanks thanks
where should i report spigot bugs?
Forum I think
?jira
thx
has to do with the way an item gets saved to a YamlConfiguration
theres a name missmatch for enchantments
still works just doesnt make sense
Hey elgar, do you know how to create a paginated menu? Like /help 1, 2, 3... with some dynamic values?
when i print a normal string with \u2713 in it, will it automatically convert it to a symbol in the console?
(efficiency is stored as SILK_TOUCH for eg)
"Working as intended"
You'd probably be best to look at teh Essentials help menu source for that
Uhh! Thanks!
Either will work, but correctly private final String claimedPlot = "\u2B1B";
what do you mean?
Blame your character set if you are complaining about what I think you are complaining
how do i even change that
Adopt vim I guess
how do i get all the contents from a specific enum here https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/CreativeCategory.html when i do CreativeCategory. it has a list of enums but i cant use CreativeCategory.<enum>.values()
I know that eclipse has a way of chaning the fonts that are used but idk how IJ works so yeah - you'd need to use vim
What do you mean by contents?
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.Player.setHealth(double)" because "this.whoToTarget" is null
oh wait im dumb mb just reliased
is it possible to get all the specific items from a specific creative category like all the redstone items for example
I think that was always a bit of magic
In an attempt to store a key-value pair in an ordered list, instead of using LinkedHashMap, I created my own simple Pair<K, V> class and did this instead ArrayList<Pair<K, V>>. In this approach, I could easily get the last entry anytime I want using the arraylist indices instead of having to iterate over every entry in LinkedHashMap, costing me like O(n). Is this approach feasible?
Feasible, yes - does it makes sense? I do not know
Well originally I wanted to have an ordered list of two variables, and thought of pairing them together instead to simplify things
Hi.
I'm trying to store a list of locations and I've used a File to store the data between server restarts. but im having some trouble retrieving and storing the list to a variable. I know that im retrieving the List correctly but when im trying to make it to the variable it breaks.
What ive tried:
public static List<org.bukkit.Location> DrillLocations = new ArrayList<>(); DrillLocations.addAll(FileHandeler.getFile().getList("Cords"));
And:
public static List<org.bukkit.Location> DrillLocations = FileHandeler.getFile().getList("Cords");
Anyone know a plugin or something so like when a player presses like E on their keyboard it executes a command?
ryan ask in #help-server
thanks
You are sacrificing O(n) .get complexity for O(1) .getLast performance, so be aware of that
big o notation"?'/

1.19-R0.1-SNAPSHOT.