#help-archived
1 messages ยท Page 75 of 1
You can't still use it in the Bukkit API
You need to convert it into an ItemStack
THANKS SO MUCH
And surely nms is version dependent which would mean you would probably have to involve modulation or abstraction.
So do you know how to fix this #help-archived message
Well that was not my point.
You seem to think we can use CraftItemStack in the Spigot API which is wrong
Its in craftbukkit which is a factor that connects the Spigot and Bukkit packages to nms stuff
AvroVulcanToday at 8:31 PM
CraftItemStack isn't in spigot or the bukkit api
it's in craftbukkit
Lol yes
'use craftbukkit' is not the answer to his issue
Still not my point jesus
I mean if you're saying nms, craftbukkit, bukkit and spigot all include in the server jar then my point wouldn't apply anyway?
because you can use the api without having access to nms methods
because the api itself doesn't have any nms methods
Yes obviously?
i don't even get what your point is
you're on about something random that you've somehow derived from his map not working
I thought he was trying to cast something from nms to bukkit
As it was printing an invalid cast exception but however that wasn't the case and then you came from nowhere making a rude inferrence.
Ok
in 1.15, MapMeta is an instanceof ItemMeta
public interface MapMeta extends ItemMeta {
though it looks like you're using 1.8
Did anyone else here experiance massive player time outs from after updating to 1.12.4 from 1.12.2
Though, looking at some old docs it also seems so
1.12.4?
@frigid ember you have the right (and only) import by the looks of it
so if you are holding a map, you should be able to cast its meta to map meta
try looking at the simple class name of the metas class to see what it actually is?
Wait so all in all spigot is down
it's being ddosd, so pretty much at the moment
i was bout to post a plugim ๐ฆ
rip
that meme where the dude walks in with pizza and everything is on fire
at least spigot has cloudflare ddos protection lmfao
...
this one,
me walking into here after realizing spigotmc is down
wait its a bloody png
that happened to me a couple times
I just got this ass plugin and can't replace it yet
why does it say atlanta
why does it say atlanta
@dense rampart because you are near Atlanta
i am nowhere near atlanta
I'm in italy so it says Rome
finally
I wonder where I live ๐ค
i live in milk way galaxy
I posted the last post before it went down ๐
my IP says I'm in Washington, Cloudflare thinks I'm in Georgia, but in reality, I'm in Texas
bamboozled
I think it went back down again
wtf i just clicked post resource and it went down again
lets vibe in vc
has anyone ever gotten
Browser: Working
Cloudflare: Not working
Host: Working
No, because then you wouldn't see the webpage!
Youtube gets ddosed
(because it's displayed by CloudFlare)
My is browser Working
CloudFlare Working
Host not working
didnt cloudflare go down twice last year
you still can't see "Cloudflare: Not working" because it is a Cloudflare page which displays that message
Omg if we got everyone in this discord server to ping YouTube we could take it down in a few seconds ๐คฃ
XD
totally
You
Browser
Working
Tallinn
Cloudflare
Working
www.spigotmc.org
Host
Error
i don't think
it's not like there aren't that many people already viewing YouTube
youtube also went down last year too
Ye just take down the USA xD
didnt sonic do that lol
i just wanna post my plugin already holy crap
oh hecc no
that happens a lot
yep
same
some times getin
and then back the fk host down
I think the server host is down
do you guys think a plugin that makes it so blazes dont attack or fly should go in Mechanics
yeah they are
Error:(3, 30) java: package org.bukkit.plugin.java does not exist
IntelliJ error can anyone help 1.8.9 btw
I told you I use Eclipse if you need me to help
yeag eclipse is way better
You need to add the API dependency
Are the forums down?
spigot got ddosed
Serious?
yup
The hell man....
Well if the website isn't working in a few seconds il be back here with me question
Yup ok
i was about to post a plugin but ig not
So im using TextComponents, but whenever the TextComponent goes on a new line, it loses color formatting. How would i fix this?
Rip Darth
idk i never used TextComponents
you need to put the color for each line
newline support was always bad in minecraft
i think
^
I mean
"support" well more like lack of support
That is a good idea, but considering i don't use ChatColors, that's not gonna work
I use color codes
It works
well they are getting ddosed so they are a bit busy too support
Why do you use TextComponent if you're using color codes
You just need to put the color code in before the next line
well I had a library for TextComponents
I need to have an [item] function
Meaning showing items in chat
That's the only reason im using it
The thing is
TextComponent supports high level formatting
which actually does work with newlines correctly
how do I force the MOTD of x server connected to bungeecord to the player?
@frigid ember what do you mean
so there is forced host x.domain in mc's server list
and you want the player to see the MOTD from x server instead of the global BUNGEE one
Well i have gotten an idea, thanks!
ddosed
they felt for the classic Alt F4 trick
rm
System.exit();
Spigot.org has had a lot of 50x errors and broken CSS the last few days. A lot of my friends are also experiencing this. Anyone else utside of scandinavia having this issue?
they got ddosed
spigot.org page not working host not responding
Hello, I'm trying to access SpigotMC and it doesn't seem to be working?
they got ddosed
Isn't that the whole point of Cloudflare.
@steady osprey source or dont toss the ddos card. Please.
some person joined like some time ago
and supposedly said spigot was insecure
ยฏ_(ใ)_/ยฏ
Cool. That does not mean anything
i was told by SavageLab developer and admins @stone chasm
and shortly afterwards, spigot was less functional
spigot is getting ddosed literally every day, lol
Isn't Cloudflare suppose to protect against that?
You would have thought
Is there a way to view a crafting recipe of a custom crafting recipe that has been made?
Like if I made a custom crafting recipe
Is there a method to display that
In like a 3x3 UI
in its own gui? or the green book thing
But like for Essentials plugin, they surely didnt hard code a new gui for every single recipe..
How did they get the recipe of an item?
idk
If I'm remembering correctly, you can iterate through a list of recipes and display them from the ingredients list.
plugin.getServer().recipeIterator() I believe
Thank you
spigots finally up
.hasPermission always returns true for the console right?
was it getting ddosed
yeah
Alright, time to go inactive for months
๐
was that yes for me?
no
;-;
but i think it does
I think as long as the permission is registered. I've seen problems where the console doesn't have permission for things sometimes
how do i delete resources i posted bc the ddos made me post 3 of the same pplugins lol
lol
Anyone know why my map zooming isnt working? https://www.spigotmc.org/threads/map-zooming-help.438322/
dont spam @frigid ember .
Hello
Anyone know any good resources to learn Spigots api/an actual explanation as to how to set up IDEA for plugin development?
I know basic java, started learning it 3 weeks ago. I come from C89/C++ so its seeming easy and I wanted to get started understanding spigot/bukkits api for minecraft.
My total goal is to design a plugin thart will be moving large block collections
IDE setup is pretty easy for the most part
you can actually watch it from "bad" minecraft coding youtubers
yeah
im just needing some good reference as to how to handle blocks/moving bnlocks/interfacing with the world
as I'm going to be making a system that will be moving lots of blocks around almost as if they are one group of blocks.
bukkit API is good designed and if you have enough prior OOP knowledge
it will be pretty self explanatory
I have decent oop knowledge. I'm not a master at it.
in your case stuff like World and Block are all referenced by objects
so you just grab this stuff using API
Alright./
and manipulate it as you want
Is there any way to say, put a bunch of dynamic block objects into some form of array or list and act on all of them as one?
e.g moving all the blocks in the list by 1 x coordinate and not overwriting eachother?
moving large block collections as in your stated goal is quite resource intensive for a server
the idea is, for the most part, everything that happens on a MC server is single threaded and happens one after another
so if your plugin is doing a lot of stuff, players can't and will eventually be disconnected
I'm likely going to separate the events on a tick schedule
there are advanced workarounds, such as async world edits (oh the heresy!), but they're fairly advanced and very error prone
ahh]
but a "normal" way to handle what you're after is do say 100 blocks per tick, and keep track where you left next tick
Right
yeah speaking of moving large amount of blocks
there are plenty of 3rd party API for that
that can do stuff really fast
now, when talking about large amounts of blocks, are we talking millions or more?
wow
because then you run into other issues such as the world changing around a player as they sit and do nothing, which can be pretty funny if done right
default API is safe for 6k blocks lol
6000 is not much
you don't even have to spread it into tasks
If I can be honest I've got the impossible dream to make a very very very very very very tiny version of movecraft. I'm wanting to make some very tiny say like 3-4 block things that move on the water as one entity
and explode
to get you going, here's an easy way to do what you want, though not most efficient: you put the blocks you want in say an ArrayList. Right?
Yes.
Then you iterate thru the blocks, and update say their Y coordinate by 1 to make them move up by 1 block
That's all
Not if you're doing it all at once in the same tick
And what happens if I want to move three blocks forward, wouldnt they overwrite eachother?
They would overwrite what's in the destination, yes
Thats also the issue
12.05 20:50:06 [Server] Craft Scheduler Thread - 9/WARN java.lang.NullPointerException
12.05 20:50:06 [Server] Craft Scheduler Thread - 9/ERROR [SCHEDULER] Exception thrown whilst executing task
My console keeps saying this, non stop. uh
Anyone know what that is?
Also, not all "blocks" are equal. For example chests... you can't move them as you please and keep their contents intact
Oh yeah i dont care about NBT tags
You have to look at what the block type is, and perform special actions in some cases.
Oh you don't need NBT to handle chests, there are API functions for doing everything you need.
but my main issue is the perceived lag of half the collection of blocks moving and then the other half moving and blocks overwriting eachother, as the blocks will be treated "together" as one collection and will all move as one entity forward/backward/etc
@terse schooner probably a bad coded plugin that's having some issues. try narrowing it down by removing plugins one at a time
Uhm
I can actually just hide the message from the console
would you advise that?
hence why I need some way to prevent blocks from overwriting eachother and instead updating all the blocks x coordinates or setting a destination, then updating them so all of them move without overwriting eachother
yes @terse schooner but it will still have an error.
no Slippy i would not. it's the equivalent of room on fire but "everything is fine."
it can mean nothing, safe to ignore, but also can mean something's not working right
no way to know just from that message
figure out what's causing it first, then make an informed decision whether to ignore it or not
@frigid ember I'm not sure what's your actual intended behavior here. So let's say... you move 1 block up. And in the destination is also 1 block (not air). You want to move that up too?
I recently installed holograms so I'm pretty sure it's that -- I've never seen this before and haven't added anything else recently
uh
And what if there's a block where that goes... you see where I'm going with this
let me get a picture for better explanation
but holograms is working fine. Everything is, actually. And even if it isn't "fine", there's no reason for me to see the same message literally like 500 times
I9 9900K or Ryzen 9 3900x for 1.15.2 survival?
what you do next is up to you ๐ but it's bad server admin practice to just hide inconvenient messages without knowing the implications
That's fine @frigid ember. So if I'm understanding this correctly you want to move as many blocks as it takes until there's an empty block (nothing to move).
again im sort of trying to make a tiny movecraft ๐
So there will be function calls that will shift the "collection" of blocks location by x y or z coordinates
Right. Well then here's an idea: starting from your "source" block, start scanning blocks in the world until you hit an air block, adding the blocks as you go in say a stack.
Then you start popping blocks from the stack and move them 1 block in the chosen direction.
Hmm
Because of how the stack works, first block you pop would be your rightmost one in your picture.
That was just an example actually... the collection may be in three dimensions...
like a sphere or something
principle still holds
And, it may or may not be in the water...
you would just have a 3d collection of stacks... lots of data
So my ridiculous goal is to find some way to generate a list of blocks that are all connected to eachother, then asynchronously (without the blocks moving into eachother) move that full collections locations
what you do if say you have 3 columns moving and only the middle one hits something?
either by x y or z
If the middle one hits something then it will be considered that the whole entity collided with something
okay then all stop moving
yeah
async isn't a thing i would recommend, to be honest
How will I prevent blocks from overwriting eachother though?
If they move into one and another the blocks no longer exist and can't be referenced
here's another idea, much simpler and with no additional memory requirements but your initial block structure
say you're moving up, right?
Yes
instead of starting from the bottom and move blocks, you start from the top of your contraption
ahh
you have a cuboid as a contraption
you scan the topmost line of blocks, ignore where's air, and where's a solid block check the block it would be moving into. if there's a solid block, stop. you hit something. if not just move that "slice"
proceed to next slice down, but this time just move everything including air blocks
and so forth until you hit bottom
Hmm.
I don't know how I would A create the cuboid region and B actually separate a 3d region into slices
cuboid region you can conceptually create it as a 3 dimension array
in fact i would actually use an old school array like Block[][][]
much faster to iterate thru than collections
Hmm ok.
so you know your contraption size, hence you can dimension the array on all 3 dimensions
then just load the contraption blocks into your array and you're set
Hmm
So now that I have an array of blocks how do i move all the blocks say forward
just a "for" loop for every index?
yes, but not like that
you have to separate your code in 2 parts: first is the first "slice" where you check collisions with the world
the other is moving everything else, including air, with no checks
got it
thing is, how would I discern the collection touching eachother as not a collision
Well say the top slice is touching the bottom slice, isnt that a collision?
say you're moving into positive X direction your contraption
yes
this means your highest X is the "slice" that moves first. say your contraption is actually a 2 by 2 block of solid stone
then first X is 0, second is 1, and so forth on all 3 coordinates right?
So I've got this now, but this is what happens when I set the zoom to farthest.
@EventHandler
public void onInteract(PlayerInteractEvent e) {
Player p = e.getPlayer();
MapView view = Bukkit.createMap(p.getWorld());
view.addRenderer(new Render());
Action ac = e.getAction();
if (ac == Action.RIGHT_CLICK_AIR) {
view.setScale(Scale.FARTHEST);
} else {
view.setScale(Scale.CLOSEST);
}
ItemStack mapItem = new ItemStack(Material.MAP, 1, view.getId());
p.getInventory().setItemInHand(mapItem);
p.sendMessage(view.getScale().toString());
}
Also do you guys know why it flckers?
Map<UUID, Integer> perPlayerCounter = new HashMap<>();
@SuppressWarnings("deprecation")
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
Integer counter = perPlayerCounter.get(player.getUniqueId());
counter = counter == null ? 0 : counter;
final WorldMap worldMap = (WorldMap) MinecraftServer.getServer().worlds.get(0).worldMaps.get(WorldMap.class,
"map_" + map.getId());
if (counter % 8 == 0) {
for (int i = 0; i < worldMap.colors.length; i++) {
worldMap.colors[i] = 0;
}
worldMap.decorations.clear();
map.setWorld(player.getWorld());
map.setCenterX(player.getLocation().getBlockX());
map.setCenterZ(player.getLocation().getBlockZ());
if (player.getItemInHand().getType() == Material.MAP
&& player.getItemInHand().getDurability() == map.getId()) {
worldMap.a(((CraftPlayer) player).getHandle(), CraftItemStack.asNMSCopy(player.getItemInHand()));
}
}
perPlayerCounter.put(player.getUniqueId(), counter + 1);
}
now, since you're moving towards positive X, the slice you process first is the one where X is 1
you keep X constant at 1, and iterate thru all Y and Z looking for collisions with blocks in the world in the corresponding coordinates
hmm
if it's air, you place the block, otherwise you stop
again what happens if the blocks are touching eachother, how can I discern the blocks touching themselves with touching blocks that arent part of the collection?
hello guys
my server has been crashed
Description: Exception in server tick loop
java.lang.OutOfMemoryError: Java heap space
at it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap.rehash(Long2ObjectOpenHashMap.java:1061)
at it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap.insert(Long2ObjectOpenHashMap.java:272)
at it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap.put(Long2ObjectOpenHashMap.java:280)
at net.minecraft.server.v1_15_R1.RegionFileSection.a(RegionFileSection.java:120)
at net.minecraft.server.v1_15_R1.RegionFileSection.loadInData(RegionFileSection.java:103)
at net.minecraft.server.v1_15_R1.PlayerChunkMap.lambda$f$23(PlayerChunkMap.java:959)
at net.minecraft.server.v1_15_R1.PlayerChunkMap$$Lambda$3325/1429481091.apply(Unknown Source)
at net.minecraft.server.v1_15_R1.PlayerChunkMap.lambda$null$24(PlayerChunkMap.java:991)
at net.minecraft.server.v1_15_R1.PlayerChunkMap$$Lambda$3388/599822419.run(Unknown Source)
at com.destroystokyo.paper.io.chunk.ChunkTaskManager.pollChunkWaitQueue(ChunkTaskManager.java:200)
at net.minecraft.server.v1_15_R1.ChunkProviderServer$a.executeNext(ChunkProviderServer.java:1065)
at net.minecraft.server.v1_15_R1.ChunkProviderServer$a.midTickLoadChunks(ChunkProviderServer.java:1051)
at net.minecraft.server.v1_15_R1.MinecraftServer.midTickLoadChunks(MinecraftServer.java:1062)
at net.minecraft.server.v1_15_R1.MinecraftServer.b(MinecraftServer.java:1254)
at net.minecraft.server.v1_15_R1.DedicatedServer.b(DedicatedServer.java:430)
at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:1169)
at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:958)
at java.lang.Thread.run(Thread.java:748)
i think you're confusing something. you know the blocks that are part of your collection
that list of blocks in your collection never changes
are block objects updated automatically?
like are the block objects literal representations of the block at x y z
@frigid ember can help me ?
.-.
@safe thunder you need to give your server more memory, if you can. otherwise trim down the plugin list so they take less resources
version?
how many players?
1.15.2 latest
oooof
how many players?
@wise dock 4
2gb on 1.15.2
yes
how often you restart your server?
I planned move 4 gb ram of server.
how often you restart your server?
@wise dock 1 day = 1 restart manually
too little you'll need like 4 or 6
@frigid ember no I tested 1.14 version is not crashed ?
2 gb ram
umm... therein lies your problem. grab a plugin to restart it every 6 hours and you should be fine, for the most part
unless your players do crazy worldedit things, it might just work fine for you
but certainly at that ram restart it more often than once per day
if only there was a library I could import that automatically gives me access to moving blocks unanimously. Does FAWE have some sort of package for the immediate moving of blocks?
yes
but certainly at that ram restart it more often than once per day
@wise dock 1 day = 1 restart is continiue ?
actually nvm i don't know what the official repo for fawe is. see this though https://github.com/IntellectualSites/FastAsyncWorldEdit
Heatseeker where can I find a reference for say a front end API for it? I don't see anything that has a reference to front end functions or stuff on there
Only src
try clicking on the "Wiki" button on top ๐
other than what's in there, you just dive in the source and see where stuff happens you can use and well... use that
Wiki doesn't havr any examples. Also the amount of code In the source is huge. I don't know where I could find a front end interface.
It may not have a front end, you may have to look in the source to see where you could hook in. Ask in their Discord for more info, I've never interacted with FAWE from my plugins
does sata/sas storage type matter for mc servers
the faster the better, yes
mc servers constantly save and load world chunks from disk, especially with many players
Hmmmmm
On a side note @frigid ember if you really want to learn MC programming, do it all yourself without FAWE. It'll be a much better learning experience, and your idea is quite complex so you'll hit quite a lot of things
All I need is a data type that can be modified or added to of a series of blocks
But when moved are movjng as one and don't overwrite eachother
There's no such thing prebuilt. You have to roll your own.
Start from a single Block and learn World interactions. How to replace in world blocks, how to make it so it appears you're moving a block and go from there
Make a single stone block appear to move 10 blocks on X axis in air
But make it so the effect is visible to in game players, like if they look up they will see a stone block travel 10 blocks say over 10 seconds
Then change your plugin so the block stops moving when it hits another block
From there you can have 2 stone blocks move at the same time. Keep expanding as you learn how to do it, until you'll be moving entire complex structures as you want
Right
Now how will I recognise a real collision vs the collection of blocks touching eachother as they shouls
This will hit quite a lot of things, such as runnables, scheduler, single thread, world interactions and so forth
I've told you how, but you need more MC programming experience to apply it.
Yes.
Do you guys know why my map isn't updating when I zoom out?
@wise dock Are there any good video tutorials for block and world interactions
and hell how to set up a plugin right?
I can learn java itself and re-learn it well with my stuff but I dont know shit about miencrafts api wel llmao
Not sure what to recommend for the time being, sorry
np
Minecraft Dev plugin'
?
Edit this to change the output of the command!
@frigid ember you need to draw the pixels yourself
This is my render class @keen compass
private final WorldMap worldMap;
public Render(WorldMap worldMap) {
super(false);
this.worldMap = worldMap;
}
Map<UUID, Integer> perPlayerCounter = new HashMap<>();
@SuppressWarnings("deprecation")
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
Integer counter = perPlayerCounter.get(player.getUniqueId());
counter = counter == null ? 0 : counter;
if (counter % 20 == 0) {
worldMap.decorations.clear();
map.setWorld(player.getWorld());
map.setCenterX(player.getLocation().getBlockX());
map.setCenterZ(player.getLocation().getBlockZ());
for (int x = 0; x < 128; ++x) {
for (int y = 0; y < 128; ++y) {
canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
}
}
}
perPlayerCounter.put(player.getUniqueId(), counter + 1);
}
If I set the zoom to normal, it only shows the center part
@frigid ember need to search further out then
128 is for a small map, and 2048 is for the largest map
just fyi
I ran into a problem when trying to get two pieces of information of an entity: where its head is facing (i.e. where they're looking at) and where its body is facing (along the XZ axis).
I expected to find the first with entity.getEyeLocation().getYaw() and the second with entity.getLocation().getYaw(), but by my testing, they're always the same thing, no matter the LivingEntity or their position. Is this a bug?
Maybe relevant: inspecting NMS' source, I found that when an entity moves its head, its yaw will be updated, but the entity will wait some time before turning its whole body to wherever they're looking at.
Oh, alright thanks @keen compass , that helps alot I thought it was 128 for all of them
128 is 8x8 chunks
and 2048 is 128x128 chunks
if that helps to see their factor
https://minecraft.gamepedia.com/Map
@frigid ember
go down to zoom details
and it gives you the size of each map for each level of zoom as well as how many chunks it represents
@keen compass I've got this so far,
for (int x = 0; x < maxValue(map.getScale()); ++x) {
for (int y = 0; y < maxValue(map.getScale()); ++y) {
canvas.setPixel(x, y, worldMap.colors[y * 128 + x]);
}
}
But I'm getting this error
a index out of bounds
in a list inside of that plugin
meaning a list is trying to grab a position out of a list that isn't valid.
it wont matter
like, hosting a 1.15.2 server
i9 9900K vs ryzen 9 3900x
idk if the trading the better multi core speeds are worth the +5% in single core speed of i9
@frigid ember the map scales at multiples of 128. The map size in pixels doesn't change, but the blocks it represents does.
It's a bug if you renamed your world
SPIGOT-5348
Though maybe not the same things yours is about saving not loading
wait, mine?
Renaming world = bug? Oh my
https://www.spigotmc.org/threads/intellij-error.438142/
I tried searching up tutorials and everything
@keen compass , so I've gotten up to this, but I'm confused now
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
int mY = maxValue(map.getScale());
for (int x = 0; x < 128; ++x) {
for (int y = 0; y < 128; ++y) {
canvas.setPixel(x, y, worldMap.colors[x + y * 128]);
}
}
worldMap.decorations.clear();
map.setWorld(player.getWorld());
map.setCenterX(player.getLocation().getBlockX());
map.setCenterZ(player.getLocation().getBlockZ());
}
I don't know how to get it to fill up the whole area when I do this canvas.setPixel(x, y, worldMap.colors[x + y * 128]); for higher zoom levels
i am running into some issues with java, i am trying to compare two strings but does not seem to be working properly, any idea how to compare the strings only and not the object
i tried compare to
show some code and tell us the issue
we can't help you with "its not working"
show code, say the issue and we will help you
theres different definitions of compare
one string that stores an initial value
and then i go into a loop
and update that inital value
code snippet would be the best at this point
being able to upload files would be good aswell
?paste
u see that?
i am pretty sure its fucked up in the compareTo line
why not use .equals?
then you should do some debugging
the way to check if strings are equal is to use .equals
you should System.out.print the strings youre trying to compare
and see what its using
its just the block data
minecraft:air
it copies every block into hashmap
in a chunk
so m ymain concern is why youre comparing block data
as strings
and not actual blockdata
what are you trying to compare exactly?
cause its fasta?
Equals probably what you want tbh
@frigid ember I think you need to update the render or add a new one
How do I get the color of a block?
k im trying matches now
i think its working?
it looks sketchy
in the file
thanks
for the help
@frigid ember
https://minecraft.gamepedia.com/Map_item_format
that tells you how to map colors of blocks to the map or how it is done anyways
Hello! I'm struggling to figure out how to set a button into the world through the Bukkit/Spigot API. Any ideas? Here's the only two attempts I've found that don't error (but still don't work):
world.getBlockAt(x,y,z).setBlockData(Bukkit.createBlockData("minecraft:stone_button"),false);
world.getBlockAt(x,y,z).setType(Material.STONE_BUTTON,false);
yeah seems to be working
cool
whats the false for
i just pass in the data and thats it
getServer().getWorld(world_name).getChunkAt(chunk_x, chunk_z).getBlock(x, y, z).setBlockData(getServer().createBlockData(blockdata));
thats what i do
false just makes it not update blocks (prevents lag since I'm using a function that sets a ton of blocks at once)
chunk.getBlock gets the block relative to the chunk not the actual block iself
i know
Yeh, but I'm not using chunks...
but it doesnt
Yeh... but it doesn't, so...
are you sure that the code is getting to that point?
Yep, It's part of a function
code snippet please
Here is my current code
if (args[0].equalsIgnoreCase("room")) {
for(Player player:Bukkit.getOnlinePlayers()){player.teleport(new Location(world,0.5,31.0,0.5,0,0));}
this.lock = true;
if (args.length == 1) {
terrain.fill(-5,28,-5,5,36,5,"air");
terrain.fill(-4,28,-4,4,28,4,"bedrock");
terrain.fill(-4,36,-4,4,36,4,"bedrock");
terrain.fill(-4,29,-5,4,35,-5,"bedrock");
terrain.fill(-4,29,5,4,35,5,"bedrock");
terrain.fill(-5,29,-4,-5,35,4,"bedrock");
terrain.fill(5,29,-4,5,35,4,"bedrock");
terrain.fill(-4,29,-4,4,29,4,"stone_bricks");
terrain.fill(-4,35,-4,4,35,4,"oak_planks");
terrain.fill(-3,30,-4,-3,34,-4,"oak_log");
terrain.fill(3,30,4,3,34,4,"oak_log");
terrain.fill(3,30,-4,3,34,-4,"oak_log");
terrain.fill(-3,30,4,-3,34,4,"oak_log");
terrain.fill(-4,30,-3,-4,34,-3,"oak_log");
terrain.fill(4,30,3,4,34,3,"oak_log");
terrain.fill(4,30,-3,4,34,-3,"oak_log");
terrain.fill(-4,30,3,-4,34,3,"oak_log");
terrain.fill(-2,30,-4,2,34,-4,"oak_planks");
terrain.fill(-2,30,4,2,34,4,"oak_planks");
terrain.fill(-4,30,-2,-4,34,2,"oak_planks");
terrain.fill(4,30,-2,4,34,2,"oak_planks");
terrain.fill(-1,31,3,1,31,3,"stone_button");
return true;}
else {
}
}```
ye
Just making a pastebin one sec
ok
im not very knowledgable with this
but stone buttons require a block face to be put on
have you tried to do that?
Me neither- this is my first time using the Bukkit/Spigot API so ๐
i have been messing around with block data for weeks
Where I'm putting it should work because there is a block north of it which is the direction buttons face opposite to by default
Material.STONE_BUTTON doesn't place
And yes correct
Edit this to change the output of the command!
?
Edit this to change the output of the command!
haha
?
Edit this to change the output of the command!
try setting the blockface @bitter palm I thin that might solve it
so minecraft:stone_button[blockface=south] or something like that idk how these work
or facing=south
'idk
But yeh, if I /setblock a button in a place where there isn't a block North of it, it will break, however when I setblock it in the locations I'm currently doing with my script, it works fine
i think you need to specify face when using blockdata
I've tried, just to be sure, but South is definitely the default and definitely the direction I need it to face ๐
did you do =south?
Yep
If I do anything else, it shows an error
So I know I've done it right since there's no error, however it still doesn't place the button
anyone got any ideas for my problem? https://discordapp.com/channels/690411863766466590/690470011382267904/709910362618593411
It's a bug if you renamed your world
haha
want me to try rn?
Seems like it ๐
lol
Sure haha
player.getWorld().getBlockAt(player.getLocation()).setType(Material.STONE_BUTTON);
thats what i did
That's what I originally did
Make block, cast it as Button, set facing to the face you want it to face
hopper might be your server again
I don't know if spigot supports metadata by specifying them in something like []
does
@bitter palm 's server seems to always do strange things
like 1 second ticks
I'm on a new server
And that was because of a plugin I used to have- I told you lol
I don't have that plugin anymore
still sounds funny af
It's as default of a server as I can now lol
If you mean Minecraft command, [] works
but you would be using classes when programming it in Spigot API
To be specific, though, my first attempt was terrain.fill(-1,31,3,1,31,3,Material.STONE_BUTTON);
https://hastebin.com/ofovecegim.java Here is the Terrain class
1.15 can be a bit sketchy
that looks like 3 buttons
im not using any time soon
Yes, it is supposed to do 3 buttons. That's what I'm trying to do
you should do
Bukkit.pleaseMrSpigot("allow me to place that button for once"):
terrain.fill(-1,31,3,1,31,3,Material.STONE_BUTTON);
Bukkit.thankYouMrSpigot("for allowing me to place that shiny button");
bruh
maybe ur other code is not working properly
other than the Material.STONE_BUTTON part
It works with most blocks except very specific things like buttons, doors and levers, it seems
so anything that has a face?
that smells like 1.15
does smell like 1.15
Maybe sleepingpie?
i tried getting drops from 1.15
guess what i found out
DIAMOND_ORE has no drops
k bro
hm
Hey guys I have a weird question
so there's no way around it. maybe md5 knows
Maybe Mojang knows. Maybe only Bill Gates knows
@bitter palm you could get handle on the tick system, stop it temporarily, read the world file and write a button to it, save the world file and flush from memory the world chunk that the button was in, then release the tick system.
Im wanting to see if a plugin exists. I want to be able to spectate a player except actually make it look like you're looking through their eyes. I want to be able to see their inventory/hand/skin if possible. I know minecraft has a built-in spectating plugin, but you cant see inventory and the hand completely disappears
I think that's the solution to place a button.
I was originally gonna say Notch knows but then I remembered the tragic days ๐
Does anybody know of a plugin that will achieve this?
you cant McMatt it would look terrible for the client
It doesnt need to look great
^^^ in spectator, you canโt see inventory, but without spectator youโd see the inside of their body & wouldnโt actually see what they see
unless the client is in spectator it wont let the server control it
hm ok
I might just have to hack it with commands
You could do some protocol magic to hide the player like in some lobby plugins but even then it would be messy
I definitely think it would be possible but wouldnโt be perfect & wouldnโt exactly be easy to accomplish, I can imagine
You wouldnโt be able to do selected slot
But for the inventory, thereโs many plugins that can do that
selected item?
Iโm lretty sure itโs in the Essentials plugin (/invsee)
No, you canโt show selected item unless you did it in some jank way using lore or enchanting the item or using a resource pack
Basically, Im creating a bot that can be controlled with code but I need to be able to spectate it as if I was the player bot
Any ideas why the wood is placed but not the button? It's not to do with facing or face, I've already tested that a ton...java terrain.fill(-4,30,3,-4,34,3,Material.OAK_LOG); terrain.fill(-2,30,-4,2,34,-4,Material.OAK_PLANKS); terrain.fill(-2,30,4,2,34,4,Material.OAK_PLANKS); terrain.fill(-4,30,-2,-4,34,2,Material.OAK_PLANKS); terrain.fill(4,30,-2,4,34,2,Material.OAK_PLANKS); terrain.fill(-1,31,3,1,31,3,Material.STONE_BUTTON);Terrain: https://hastebin.com/ofovecegim.java
Well yeh I want buttons haha
k il mess around with it
should probably explain the way you place blocks, what terrain does xD
it's not really straight forward
Fair enough, I'll try my best even though you did most of it haha
Pretty much, it has a queue (batchQueue) and when the fill function is called, it adds every block in that region to the queue and every tick, a batch of blocks (per) from the queue is placed into the world (unless the queue is empty, off course)
Wait, so.. Martoph, does that mean it'll resolve if I rename my world to NORMAL or wtv?
Can anyone give me some suggestions of how to reduce lag. https://timings.aikar.co/?id=9756b7794eab4772a1858b8c4acaaf35
@bitter palm i have determined that the fill function works with stone buttons
on 1.13.2
So why not on 1.15.2? ๐ค
not too sure
Have you tried /ds room? Does the actual room generate fine in 1.13.2?
Yep
there were errors on console
org.bukkit.plugin.AuthorNagException: No legacy enum constant for OAK_PLANKS. Did you forget to define api-version: 1.13 in your plugin.yml?
i think those ez to fix
hello, my heroes premium plugin is not working properly, everytime that a player joins or re-joins my server, the plugin does not show itself, i have to type /reload so i and the player can see the life, mana, stamina and etc, and i dont want to type that everysingle time that a player joins or re-joins the server
change the api-version in plugin.yml xd
Hm very odd
with the buttons
Can anyone give me some suggestions of how to reduce lag. https://timings.aikar.co/?id=9756b7794eab4772a1858b8c4acaaf35
@full mist
Anyone have any ideas?
What's the best way to ask a question from the Spigot devs?
@full mist
Anyone have any ideas?
@full mist
I use LaggRemover plugin, but i dont have enough players on my server to know if it is working
@worldly yacht Have any idea whether Clearlag or Lagg remover is better?
i dont have any knowledge about clearlag, i am hearing about it from you
Friends, I'd like to ask you a question.
Is how to compile multiple ".java" files together and finally compile a jar file.
@stiff monolith Use Apache MAVEN.
how do i talk with an staff? i have buy an plugin and its not working propperly
Just click on his avatar.
@bitter palm
@full mist Thank you. Can you teach me in detail? I'm not very good at java.
hm?
proof
Lol I can't write java only compile it sorry @stiff monolith . Check out how others have done their pom.xml files.
And if MAVEN is too hard use Gradle.
Now I'm getting a copy of the source code, and I'm going to modify some of the text and compile it.
tf
gone
Oh I know why
What do you mean, disappear?
poof
cos when the plugin loads, it gets the room ready to start building
Anyone have any suggestions to my issue with my server?
Can anyone give me some suggestions of how to reduce lag. https://timings.aikar.co/?id=9756b7794eab4772a1858b8c4acaaf35
And it builds everything else when a player joins
maybe thats why it does not work for you?
Steviebeenz ur spamming a lot ngl
No DENY, because once you rejoin they'll reappear I bet
mk
ye
Likely an issue to do with Spigot 1.15 not being fully bugproof yet
i tried hosting a vanilla minecraft server a few months ago the latest version
and it could not even generate the chunks
tells u how bad mojang implemented the code for spawn area generating
Is it possible to get light level from an itemstack? Like how a torch is 14 and glowstone block is 15
Can anyone give me some suggestions of how to reduce lag. https://timings.aikar.co/?id=9756b7794eab4772a1858b8c4acaaf35
@full mist
Plz help
When i googled it and stuff all i get is people trying to set a light level lol
@full mist You should really stop spamming. Telling people to 'plz help' isn't gonna get you anywhere. It's just annoying tbh
@bitter palm you could try to get the value of Material
instead passing the Material object
just the string
and use the value of static function in Material
just a guess might work
Material.valueOf("STONE_BUTTON");
I'll try in a minute- on my phone
yo, I'm running into some weird problems
My server likes to crash when new people log on - I think it has something to do with chunks or the world
The world is 8000x8000 so it's rather large - the server will also crash nearly instantly if anyone teleports a long distance away
Currently running with GGServers and 3GB of RAM
I've had around 13 people on before with very little lag, even while worldediting - the server just likes to crash for reasons unknown
if it helps, the server is also notorious for failing to connect to an SQL database - while in a test environment though, this is not the case
I use GGServers and don't have these problems, so I think you can probably rule them out.
(They do have issues with their SQL databases though)
Have you checked your console logs? It usually prints why the server stopped.
Although I suppose one of their machines could be faulty.
might be - the server seems to encounter a gigantic lag spike, then crashes
Does everyone time out?
yep, times everyone out and the server crashes
In a PlayerInteractEvent, how do I say "I handled this event, do not also fire this for the off hand"?
i wrote an InteractCooldown class which pauses every interaction by one tick
@frigid ember Sounds like something is blocking your main thread tbh
that might be just the thing
The console should print a MASSIVE stacktrace if that's the case
@frigid ember valueOf didn't make a different ;-;
i run sql asynchronously, but perhaps sql isn't the issue here
u sure u used it correctly
sometimes it inexplicably fails to connect
@bitter palm What are you trying to do
Jeroen, iirc the event is fired for both hands before any plugins see them. You can check which hand and then only do your code on one of them.
In 1.13, my plugin places 3 buttons, however in 1.15, it doesn't work. No errors, but I just can't place any blocks/materials/BlockData with a facing attribute in 1.15
If I try to setType or setBlockData a button, door, sign or anything like that in 1.15, it just ignores that line of code it seems or something but works fine in 1.13
Jeroen, iirc the event is fired for both hands before any plugins see them. You can check which hand and then only do your code on one of them.
@golden vault So I cannot mimic the vanilla behaviour of prioritising the main hand?
Or is there a way to get the cancelled status of the main hand from the off hand?
@bitter palm Try casting to Directional and then use setFacingDirection
What do you mean by casting to Directional
what is the supperclass of Directional
what exactly are you doing?
Directional is a block that has multiple directions. So buttons, banners, beds, trapdoors, etc. https://hub.spigotmc.org/javadocs/spigot/org/bukkit/material/Directional.html
Me?
ya
so the superclass is block
Alright I'll have a look
I am adding custom behaviour to a compass, but when it's in the main hand, it still causes the player to use the off hand, for instance to eat etc.
I setCancelled(false)
nah its BlockData
extends BlockData
Directional blockdata = block.getBlockData();
should work
Is the right course of action here to in the offhand event to check if the mainhand was cancelled or not?
Since I have no idea if that is possible, and emulating the behaviour without actually executing it could get complex...
Honestly I am not sure if there is anything linking the two events that you could use
and u need to cast it too
Material.Directional.STONE_BUTTON doesn't resolve; what am I doing wrong?
wat
is that
Directional blockdata = (Directional) getServer().getWorld("world").getBlockAt(0, 0, 0).getBlockData();
here is example
so what would I change this to Material.STONE_BUTTON (I'm using a function that requires a Material object)
u can create blockdata
Directional blockdata = (Directional) getServer().createBlockData("minecraft:stone_button");
when ur done with the blockdata
u can set it to any block u want just use setBlockData
directional can set the face
Is it not possible to use a Material? Otherwise I'ma have to rewrite my fill script again ๐
Directional blockdata = (Directional) getServer().createBlockData(Material.STONE_BUTTON);
this should work too
But that's a Directional object?
If I want no other plugin to handle the event that I handled, what is the right course of action?
basically
I don't quite understand ;-;
I know
but
Can I convert a Directional with a face into a Material
Because my fill function only accepts materials
Material is just one part of the block data
Ok so how do I use it..?
How would I change terrain.fill(-1,31,3,1,31,3,Material.STONE_BUTTON); into a directional?
that just passes the material
that has nothing to do with directional
u have to pass BlockData
to use directional
Ok
material only tells you if ur block is going to be oak or air
its not gonna tell u where its facing whether its opened or not
ikik
u use BlockData for that
If it's legit just BlockData that we're trying here
I already tried that
I'm confused ;-;
i dunno
https://pastebin.com/dxYA1EcE I tried with BlockData
terrain.fill(-1,31,3,1,31,3,"stone_button");
yeah but
bottom line here
is
there is a SELF face
and it seems to be not working
Directional allows you to set the face manaully
Hello how can i make mysql in ubunte 16
terrain.fill(-1,31,3,1,31,3,"stone_button[face=wall,facing=north]");?
thats why that dude mentioned it
k wait
minecraft:stone_button[face=wall,facing=north,powered=false]
put that as block data
and try it
minecraft: Is added by https://pastebin.com/dxYA1EcE
but sure
Ok well I found the problem...
you should also try all the face to see if any work if faces are really the problem
wat is it
The problem is that I'm a blind idiot >.<
hmm
I moved to a new server cos the old one I was testing on had a few things messing with ticks and I couldn't be bothered to fix it
And I was still saving to the old server
k but is it placing buttons now
so what actually fixed it
No need for facing, Directional, BlockData
All I needed to do was save the jar to the right server
so it was just the old server that had problems?
No. I was saving the plugin to a server called MMHM. I was loading a server called DeathSwap wondering why the features I added to the plugin I only added to MMHM wasn't working on DeathSwap, a server I didn't add the new jar to
๐คฆโโ๏ธ
It's me who has problems ;-;
been there though
I've been here too many times to count when doing Python stuff
When will I learn? ;-;
I've legit been trying to make my plugin set these buttons since midnight BST. It's nearly 6AM now
๐ ๐ซ
Yeh
๐ ๐ค
Ok should probably stop trying to get the best suicide emoji haha
Worst 6 hours of my life. 0/10 IGN
I should probably get some sleep. I was supposed to go to bed 7 hours ago...
ok nice
is there a decent way to directly set nbt tags the same way you would in command line?
๐
oh hold up I just got a 502 also
why is it happening
because the gateway is bad
its working now
do u gus know a free rpg plugin
CafeBabe doesn't like my forum username :I
Ah, yes. Indeed, such a mystery
I would say let's see who can get the most messed up webpage but I can't post images ;-;
Oh, it seems to be over
its not fixed for me
