Ships
Ships
Source Code - Github |
JavaDocs |
Sponge version |
Discord channel |
Translate Core |
---|
Looking for Dev builds?
Dev builds give off new features and bug fixes before they are officially released, however these features and bug fixes may not have been tested as much as a release on here
Old page:
I am testing this new page out. I am aware of some parts that are missing such as ship types, but please say if there is anything that you wish to see. I plan on making a FAQ's that includes common questions such as how to change ship requirements.
If you want to see the old page, it is here
Video tutorial
Ships 6 changes
Ships has gone through many changes, Ships 6 is the latest rewrite of the plugin. The latest rewrite fixes multiple bugs found in the root of previous versions of Ships.
Features
Moving ships
As the name of the plugin suggests, you can create your own ship and move it with just a single click.
Works with all blocks
There is a fully-fledged list where you can configure every block to react differently for the ships, including being able to add a block type to interact with Ships, detect it as a collide, and even not react at all.
Teleport to ships
There have been many requests to be able to teleport to ships for not only this plugin but others like it. This feature has been added to Ships, however, if it is something you do not wish, then you can disable to command by not adding the command.
Falling Ships
Ships will fall/sink if requirements are not met, this could be done through your own interaction such as running out of fuel, or by something else such as a TNT explosion.
Ship types
Airship | Link |
Ship | Link |
Marsship | Link |
Submarine | Link |
Plane | Link |
Hybridship | Coming soon |
Move the ship:
In Ships, movement is done by signs. You can see all signs here
Collide types:
Name | ID | Description |
---|---|---|
Detect collide | DETECT_COLLIDE | If Ships detects this block in the way of a ship moving then the ship will not move with the error of this block being in the way |
Material | MATERIAL | Material means that you can build a ship out of this block and the Ships block detection system will detect it as part of your ship |
Ignore | IGNORE | If Ships detects this block in the way of a ship moving then the block will break and the ship will take its place |
Permissions
Permission node | Description |
---|---|
ships.cmd.info |
Allows the player to use the command '/ships info' |
ships.cmd.blockinfo |
Allows the player to use the command '/ships blockinfo' |
ships.cmd.shiptype.create |
Allows the player to use the command '/ships shiptype create' |
ships.cmd.config.set |
Allows the player to use the command '/ships config set' |
ships.cmd.config.view |
Allows the player to use the command '/ships config view' |
ships.cmd.blocklist.set |
Allows the player to use the command '/ships blocklist set' |
ships.cmd.blocklist.view |
Allows the player to use the command '/ships blocklist view' |
ships.cmd.ship.track |
Allows the player to use the command '/ships ship track' |
ships.cmd.ship.eot |
Allows the player to use the command '/ships ship eot' |
ships.cmd.ship.crew |
Allows the player to use the command '/ships ship crew' |
ships.move.own.ships.airship | Allows a player to move own airship |
ships.move.own.ships.watership | Allows a player to move own ship |
ships.move.own.ships.marsship | Allows a player to move own marsship |
ships.move.other.ships.airship | Allows a player to move anyones airship |
ships.make.ships.airship | Allows a player to make a airship |
ships.remove.other |
Allows a player to destroy anyones ships sign |
Developers:
Looking for a development wiki? maven/gradle dependencies? or something else relating to ships or translate core? Take a look at the getting started wiki
In reply to Sixela963:
Ships 6 was and still is a huge undertaking. The idea of a full transformation came in around Ships 4.1 sort of time. While Ships 5 did start from the ground up, i was still young in the programming world and well, my code wasn't great so I didn't aim as large as Ships 6. Not only that but there wasnt a need for the compatibility layer of Core as Bukkit was the only platform I supported and the DMCA takedown of bukkit was no where in sight. But a huge undertaking is a statement I would agree with.
So BlockDetail. You are correct. BlockDetail is just a interface with the base implementation being BBlockDetail that covers most blocks. Then there are other blocks that require extra special rules such as those with TileEntities.
As for the runnables in the movement algorithm. Im guessing you looked at the Ships 6 movement algorithm. The reason why there are runnables in that case is because all the blocks do not get processed on the same tick. Due to the fact there are a lot of users of ships who use large ships and the fact minecraft can not handle multiple threads that process the world, bukkit can not send multiple block changes over a single network packet and a few other issues. All the blocks being processed on a single server tick will crash the server with "stack overflow error" or "tick took X seconds" (depending on the algorithm being used) so some creative ways to process heaps of blocks have been made, one of them is to break down the huge chunk of blocks into smaller more process friendly heaps of blocks. So yes, all the runnables are required. However to handle a small heap of blocks, say 1-3500 blocks, you wouldn't need to use runnables ... That being said, if your getting into the 1000s then i would consider it.
As for your error. Im not seeing any of the error relating to your code. So my question is how are you setting the block? Code wise?
Block block;
block.setType(Material.AIR);
?
In reply to mosemister:
Yes, I am using block.setType(Material.AIR). block.breakNaturally() also crashes.
Here is my code:
The general idea is to "move" the dispenser forward one block in the direction it is facing if it holds a particular item, in this case a book and quill. Everything works fine if I don't remove the original dispenser.
After some further testing it seems that even without the rest of the code, removing the block causes a crash. Am I doing something that shouldn't be done in this?
Thanks a lot for helping me out; if this problem persists I will ask the question on bukkit forums to stop spamming your comment section. (honestly I should have done that in the first place but somehow didn't think of it.)
In reply to Sixela963:
Ive not got a pc infront of me. But the code seems logically ok, even if it isnt in my style.
There are cases where bukkit implementation is the fault. It maybe that spigot did some efficiency improvements so it doesn't reset the keys on a new block but they forgot to remove the keys that should be removed.
In my early days i used Bukkit forums to help when I needed it, while i never made a topic on it, it did come in useful.
This is a post made on the spigot issue board that sounds like the issue you are having.
" order by created DESC" rel="noopener nofollow" target="_blank">https://hub.spigotmc.org/jira/browse/SPIGOT-2095?filter=-4&jql=text ~ "Get property" order by created DESC
Its been marked as resolved so try updating your bukkit version and see if that helps
In reply to mosemister:
Seems like that issue is two years old, and I am using the latest spigot API...
Well that's a bummer, the second plugin I ever make and it doesn't work, but it's not even my fault. I'll try to find a workaround, maybe ask around bukkit forums, and propably file a bug report.
Out of curiosity, when you said "not your style" what did you mean by that? how would you have done it?
Thanks a lot for the help!
In reply to Sixela963:
Every programmer has a unique style to writing there code. Styles can be similar in ways.
The similar style i was refering to there is where you return out of the function as soon as possible instead of indenting into a if statement. I find it simpler to read as many forum posts including this one destroy formatting (indentation, wrapping, etc) so if you copy and paste the code into a text editor such as notepad++, you can still easily read the code even if its missing the indentations.
So for example. You may write
int A;
int B;
if (A < B){
//Do stuff
}
While i may write
int A;
int B;
if(A => B){
return;
}
//Do stuff
There are other parts of code style, but thats the one im refering to. In this case there is no efficiency benefit for either, however I have seen some code styles that do effect efficiency. But because its not my code style, it makes it more difficult for me to read it. Someone with similar code style will find your code easier to read
Like i said before, im not on my pc so i can not check your code, so it maybe a logical error im not seeing unless i debugged the code.
one of my ships is size 48 and moves super fast with almost no delay, while the other one is size 459 and moves super slow, i thought that was just the way the ships worked and maybe it actually is, but when i right clicked the ships sign to see the ship info they both had the same max speed as 10, is there any way i can make the ship faster or no, is my original theory correct, the more blocks it has the more processing has to go into it, i should also clarify both of them are OPShips
In reply to waffledragon122:
Your theory is correct. The more blocks the more blocks it needs to find (the hardest to process) and process.
You can change the speed of the ship by going into the "VesselData" file for the ship and change it there. Remember to change the speed on the sign too. Just to make sure your on the correct page. The "speed" of the vessel is how many blocks it moves by, it has no impact on processing speed.
In reply to waffledragon122:
Oh just so you know. If your running Ships 6, there is a option to only update the ships structure if manually told so. This will increase the performance of movement by a lot as the searching for blocks doesnt occur
Can you join my server to help me pls?
First everthing was 'in the way'
And now he doesn't track me ship at all
IP: kazikohli.backspin-hosting.com
discord: BRO-Kohli#6892
In reply to Forge_User_42769262:
While i do join servers to help. I normally attempt to fix the server by talking first as a lot of the time its issues on the server side that a user can not see.
Ill hit you up on discord.
In reply to Mosemister:
Okay, thank you so much. I'll wait a while :)
And ow, I realize that you had sent me a friend request that I accidentally canceled
i keep getting this error
[20:12:04] [Server thread/ERROR]: Could not pass event InventoryCreativeEvent to Ships v5.0.1.14
org.bukkit.event.EventException: null
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:320) ~[server.jar:git-Spigot-9de398a-9c887d4]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[server.jar:git-Spigot-9de398a-9c887d4]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:529) ~[server.jar:git-Spigot-9de398a-9c887d4]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:514) ~[server.jar:git-Spigot-9de398a-9c887d4]
at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:2289) ~[server.jar:git-Spigot-9de398a-9c887d4]
at net.minecraft.server.v1_14_R1.PacketPlayInSetCreativeSlot.a(SourceFile:23) ~[server.jar:git-Spigot-9de398a-9c887d4]
at net.minecraft.server.v1_14_R1.PacketPlayInSetCreativeSlot.a(SourceFile:9) ~[server.jar:git-Spigot-9de398a-9c887d4]
at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:19) ~[server.jar:git-Spigot-9de398a-9c887d4]
at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18) [server.jar:git-Spigot-9de398a-9c887d4]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeTask(SourceFile:144) [server.jar:git-Spigot-9de398a-9c887d4]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) [server.jar:git-Spigot-9de398a-9c887d4]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeNext(SourceFile:118) [server.jar:git-Spigot-9de398a-9c887d4]
at net.minecraft.server.v1_14_R1.MinecraftServer.aX(MinecraftServer.java:910) [server.jar:git-Spigot-9de398a-9c887d4]
at net.minecraft.server.v1_14_R1.MinecraftServer.executeNext(MinecraftServer.java:903) [server.jar:git-Spigot-9de398a-9c887d4]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeAll(SourceFile:103) [server.jar:git-Spigot-9de398a-9c887d4]
at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:886) [server.jar:git-Spigot-9de398a-9c887d4]
at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:820) [server.jar:git-Spigot-9de398a-9c887d4]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_221]
Caused by: java.lang.NoSuchMethodError: org.bukkit.inventory.Inventory.getName()Ljava/lang/String;
at MoseShipsBukkit.Listeners.BukkitListeners.inventoryClick(BukkitListeners.java:512) ~[?:?]
at sun.reflect.GeneratedMethodAccessor122.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_221]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:316) ~[server.jar:git-Spigot-9de398a-9c887d4]
idk if its related, but signs dont work at all.
In reply to bonboygaming:
Hi. What MC version are you running?
Bug report for version R2 Alpha 2.6:
16.09 18:12:57 [Server] INFO SkyHeart_Ruins issued server command: /ships shiptype create
16.09 18:12:57 [Server] ERROR null
16.09 18:12:57 [Server] INFO org.bukkit.command.CommandException: Unhandled exception executing command 'ships' in plugin Ships v6.0.0.0
16.09 18:12:57 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[patched_1.14.4.jar:git-Paper-187]
16.09 18:12:57 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.14.4.jar:git-Paper-187]
16.09 18:12:57 [Server] INFO at org.bukkit.craftbukkit.v1_14_R1.CraftServer.dispatchCommand(CraftServer.java:739) ~[patched_1.14.4.jar:git-Paper-187]
16.09 18:12:57 [Server] INFO at net.minecraft.server.v1_14_R1.PlayerConnection.handleCommand(PlayerConnection.java:1800) ~[patched_1.14.4.jar:git-Paper-187]
16.09 18:12:57 [Server] INFO at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:1608) ~[patched_1.14.4.jar:git-Paper-187]
16.09 18:12:57 [Server] INFO at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:47) ~[patched_1.14.4.jar:git-Paper-187]
16.09 18:12:57 [Server] INFO at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.14.4.jar:git-Paper-187]
16.09 18:12:57 [Server] INFO at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:23) ~[patched_1.14.4.jar:git-Paper-187]
16.09 18:12:57 [Server] INFO at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18) ~[patched_1.14.4.jar:git-Paper-187]
16.09 18:12:57 [Server] INFO at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.14.4.jar:git-Paper-187]
16.09 18:12:57 [Server] INFO at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.14.4.jar:git-Paper-187]
16.09 18:12:57 [Server] INFO at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.14.4.jar:git-Paper-187]
16.09 18:12:57 [Server] INFO at net.minecraft.server.v1_14_R1.MinecraftServer.aX(MinecraftServer.java:1013) ~[patched_1.14.4.jar:git-Paper-187]
16.09 18:12:57 [Server] INFO at net.minecraft.server.v1_14_R1.MinecraftServer.executeNext(MinecraftServer.java:1006) ~[patched_1.14.4.jar:git-Paper-187]
16.09 18:12:57 [Server] INFO at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.14.4.jar:git-Paper-187]
16.09 18:12:57 [Server] INFO at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:990) ~[patched_1.14.4.jar:git-Paper-187]
16.09 18:12:57 [Server] INFO at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:923) ~[patched_1.14.4.jar:git-Paper-187]
16.09 18:12:57 [Server] INFO at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
16.09 18:12:57 [Server] INFO Caused by: java.lang.ArrayIndexOutOfBoundsException: 2
16.09 18:12:57 [Server] INFO at org.ships.commands.legacy.shiptype.LegacyShipTypeCommand.lambda$run$0(LegacyShipTypeCommand.java:33) ~[?:?]
16.09 18:12:57 [Server] INFO at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) ~[?:1.8.0_212]
16.09 18:12:57 [Server] INFO at java.util.HashMap$KeySpliterator.tryAdvance(HashMap.java:1577) ~[?:1.8.0_212]
16.09 18:12:57 [Server] INFO at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126) ~[?:1.8.0_212]
16.09 18:12:57 [Server] INFO at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:499) ~[?:1.8.0_212]
16.09 18:12:57 [Server] INFO at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:486) ~[?:1.8.0_212]
16.09 18:12:57 [Server] INFO at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_212]
16.09 18:12:57 [Server] INFO at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152) ~[?:1.8.0_212]
16.09 18:12:57 [Server] INFO at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_212]
16.09 18:12:57 [Server] INFO at java.util.stream.ReferencePipeline.findAny(ReferencePipeline.java:469) ~[?:1.8.0_212]
16.09 18:12:57 [Server] INFO at org.ships.commands.legacy.shiptype.LegacyShipTypeCommand.run(LegacyShipTypeCommand.java:33) ~[?:?]
16.09 18:12:57 [Server] INFO at org.ships.commands.legacy.LegacyShipsCommand.run(LegacyShipsCommand.java:66) ~[?:?]
16.09 18:12:57 [Server] INFO at org.ships.implementation.bukkit.command.BCommand.onCommand(BCommand.java:27) ~[?:?]
16.09 18:12:57 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.14.4.jar:git-Paper-187]
16.09 18:12:57 [Server] INFO ... 17 more
Most other commands give me *ships <args>* including /ships reload
And with /ships shiptype create, it doesn't recognise any of the designs in the plugin, saying unknown ship type must be cloneable.
Hitting the [eot] sign while in creative will break it unlike the others.
Some blocks cause these errors in the log with each ship movement:
16.09 18:40:32 [Server] INFO Block: minecraft:oak_planks
16.09 18:40:32 [Server] INFO Failed: TileEntity
if I write the wrong ship type in the sign it'll flood the console with error reports.
And attempting to sit in a stair with a chair plugin causes the player to be kicked out, and a mannequin left in it's place.
In reply to Forge_User_50238638:
Hi. Thanks for the bug report. The crash in your comment will be fixed in the next update.
There seems to be some confusion, the commands given on this page are for Ships 5 as it is currently the latest stable build of ships while you are using Ships 6 alpha, ships 6 does not have much documentation as I have been focusing on getting it stable so commands such as '/ships reload' do not exist, you can see all the commands of Ships 6 by just using the command '/ships' As for the shiptype create command, it is asking for the ship type id.
All commands have full support of the tab complete and suggestions to assist when writing.
The Server [INFO] has already been resolved on my build of Ships, so it will be fixed in the next update.
As for Chairs reloaded, that was a addon for Ships 5, it does not work for Ships 6 currently. There is plans to update this to work.
In reply to Mosemister:
Understood, thanks for clarifying, happy to help.
In reply to Forge_User_50238638:
Quick question, when can we expect the next update? I'm setting up a public server and knowing the time frames help.
And do you have any plans for adding Cannons support? Rk moving the ship will reset a Cannon. Cheers.
In reply to Forge_User_50238638:
I typically update the ships plugin once per week, however I have been focusing on the sponge edition of Ships lately so thats why there wasnt one last week. Anyway I should be uploading the new update tomorrow (around 17:00-19:00 London time), it will need to be approved by dev.bukkit. on average it takes around a day for approval in my experience, but with the exception of the last update, its been approved within a hour of upload.
As for cannons support, I have attempted multiple times for different major versions of ships, however each version had a unexplained bug. I will be attempting with ships 6 but no promises.
I do have a few other plugins I plan to add support for, including one that will be announced and released later this week (if all goes to plan)
In reply to Mosemister:
Exciting, looking forward to seeing what comes next.
In reply to Forge_User_50238638:
Ships -b 6.0.0.0 alpha 2.7 has now been uploaded, awaiting approval
Edit:
Approved