Skip to content
cccm5 edited this page Aug 8, 2018 · 3 revisions

Craft Template Files

Index

  1. Overview
  2. General Rules
  3. Basic Example
  4. Advanced Configuration
  5. Permissions

Overview

Movecraft requires .craft file templates to function, None are included in the initial download, as to not conflict/overwrite existing .craft files during an update. You will need to create or use the examples below to get started. {name}.craft files are stored in the plugins/movecraft/types folder. The {name}.craft template's define characteristics and capabilities of each moveable_craft_, Whether you want to use Sea based ships, Air ships, Submarines or Torpedo's; each needs its own {name}.craft file.

General Rules

  • You can't use tabs in the {name}.craft file. You have to use spaces instead.
  • Use # to put comments in your {name}.craft file. The # character and everything after it on that line will be ignored.
  • .craft files are a YAML format file, and any .craft file in the types directory will be loaded.
  • Permission to use each ship is based on the {name}.craft files name, For example, if you have a craft named "Airship", you would need movecraft.Airship.pilot, movecraft.Airship.move, and movecraft.Airship.rotate in order to completely use it, Check the permissions section below.
  • Your .craft file must consist of at least the following fields in the basic example below.

Basic Example

Filename: Airship.craft

Location: plugins/movecraft/types

# This is the name of the craft type.
# To pilot this craft type, A sign needs to be put on the craft with this exact name.
name: Airship 

# The Maximum size in blocks this crft type can be.
maxSize: 100000

# The minimum size in bocks this craft type can be.
minSize: 1000

# This is a list of blocks, using their Block ID, you can make your craft out of.
# If you have a block that isn't on the list, that block won't be part of your ship.
# This could prevent your craft from being able to be piloted or possible being able to move, because it is blocking the ship. 
allowedBlocks: 
    - 5 # Wood
    - 8
    - 9
    - 10
    - 11
    - 17
    - 20
    - 23
    - 25
    - 26
    - 29
    - 33
    - 34
    - 35 # Wool
    - 41
    - 42
    - 43
    - 44
    - 47
    - 49
    - 50
    - 51
    - 53
    - 54
    - 55
    - 57
    - 58
    - 61
    - 62
    - 63
    - 64
    - 65
    - 68
    - 69
    - 70
    - 71
    - 72
    - 75
    - 76
    - 77
    - 82
    - 85
    - 87
    - 89
    - 92
    - 93
    - 94
    - 95
    - 96
    - 98
    - 101
    - 102
    - 107
    - 109
    - 112
    - 113
    - 114
    - 116
    - 117
    - 118
    - 122
    - 123
    - 124
    - 125
    - 126
    - 130
    - 131
    - 133
    - 134
    - 135
    - 136
    - 138
    - 139
    - 140
    - 143
    - 144
    - 145
    - 146
    - 147
    - 148
    - 149
    - 150
    - 151
    - 152
    - 154
    - 155
    - 156
    - 157
    - 158
    - 159
    - 171
    - 172
    - 173
# This is a list of blocks that if your ship is touching when you go to pilot a craft, will cause it to fail. 
# You can add blocks to this list to use as "locks", for example a gold block.
forbiddenBlocks:
    - 7

# Can this craft type fly
canFly: true

# Speed in metres per second. 
# Maximum is 20.0, however 10.0 is recommended as the maximum for smooth movement and decent performance.
# If this is a large craft it is recommended to keep this very low to avoid lag, and compensate for this using a cruiseSkipBlocks (see Advanced)
# Important: you must have a trailing ".0" after the number here. IE: 5.0, not just 5
speed: 7.5

# Under development. Recommend you set this to false. 
tryNudge: false

# This is the type of block(s) that are required for the craft to be piloted.
# Block Types are measured in percentages (Second - {num}) from your entire ship size that are required number of flyblocks your ship must have.
# In the example below; If the total number of blocks in your craft equal 100. 25 of those blocks, but no more than 50, must be wool blocks. The rest can be any other allowedBlocks.
# the example also shows Obsidian (Block 49) is not required, but can only have a maximum of 10% on the craft.
- 50.0
- 100.0
flyblocks:
    35:
        - 25.0
        - 50.0
    49:
        - 0.0
        - 10.0
# Multiple Flyblock entries, also supporting above meta data tags. Put them in brackets, ie:
#["5:1","5:2","5:3",35]:
#    - 55
#    - 100

Advanced Options

# Not Required, defaults to true. 
# If set to false ("allowHorizontalMovement : false"), then Movecraft will ignore any pilot-induced horizontal movement. 
# IE: pointing your pilot tool left or right and right clicking will not move the craft, and will not result in any failure messages. 
# Other vertical movement, like from useGravity or sinking, will still be processed as normal. 
# This is typically used for ocean going ships.
allowHorizontalMovement: true 

# Not Required, defaults to true. 
# If set to false ("allowVerticalMovement: false"), then Movecraft will ignore any pilot-induced vertical movement. 
# IE: pointing your pilot tool up in the air and right clicking will not move the craft, and will not result in any failure messages. 
# This is typically used for elevators or turrets.
allowVerticalMovement: true 

# Not Required, defaults to false. 
# If set to true ("canCruise: true"), then the craft is allowed to have an automatic cruise command sign. 
# Do this by placing a sign on the craft which reads "Cruise: OFF". 
# The sign must be placed on another block, and can not be a free-standing sign. 
# Then pilot the craft and right click the sign. 
# The craft will then continue to attempt to move forward until you right click the sign again.
canCruise: false 

# Not Required, defaults to true. 
# If set to false, (canDirectControl: false) the pilot can not use Direct Control to pilot the craft. 
# Direct Control is a method where, as opposed to using the pilot tool to control the craft, the pilot's player movements control the craft directly. 
# When the player moves forward, the craft moves forward. 
# When the player moves left, the craft moves left. 
# To move up, right click with the pilot tool. 
# To move down, hold down shift and right click with the pilot tool.
canDirectControl: true 

# Not Required, defaults to false. 
# If set, (canHover: true) the craft can hover a certain distance above terrain.
# Use this for a vehicle that should follow the contours of the landscape, for example a hovercraft or car.
canHover: false 

# Not Required, defaults to true. 
# If set, (canHoverOverWater: true) the craft can hover a certain distance above water. 
# Use this for a vehicle that should follow the contours of the landscape, for example a hovercraft.
canHoverOverWater: true 

# Not Required, defaults to false. 
# If set to true ("canStaticMove: true"), then the craft is allowed to have a move command sign. 
# Do this by placing a sign on the craft which reads "Move:" on the first line, and the second line reads "0,0,1000" with the corresponding desired x,y,z amounts to move the craft by. 
# Note that there are no spaces in the sign text. 
# This also enables "Rmove:" command signs for the craft. 
# This behaves exactly like the "Move:" sign, except the direction will rotate as the craft rotates. 
# If a player is facing the sign, then the X coordinate will indicate how far the craft will move to the player's left or right, where a negative number moves left and a positive number moves right. 
# Similarly, the Y coordinate moves down (-) and up (+), and the Z coordinate moves backward (-) and forwards (+).
canStaticMove: false 

# Not Required, defaults to false. 
# If set to true ("canTeleport: true"), then the craft is allowed to have a teleport command sign. 
# Do this by placing a sign on the craft which reads "Teleport:" on the first line, and the second line reads "100,87,300" with the corresponding desired x,y,z coordinates to teleport the craft to. 
# Note that there are no spaces in the sign text. 
# This is a very powerful ability, as the ability to easily teleport anywhere you like basically bypasses about 1/3 of the game. 
# Accordingly, it is recommend you restrict a craft with this ability to certain users, or make them extremely expensive, or both.
canTeleport: false 

# Not Required, defaults to 0.0. 
# If set to a number (collisionExplosion: 4.0), then if the craft collides with any block it will cause an explosion of the magnitude indicated. 
# An explosive value of 4.0 is roughly equivalent to TNT. 
# This can be used to create ship collisions and ramming, as well as aerial and naval torpedoes.
collisionExplosion: 0.0 

# Not Required, defaults to false. 
# If set to true ("cruiseOnPilot: true"), then when you right click the command sign for the craft it will immediately begin moving in the direction indicated by the command sign.
# IE: it will move in direction opposite the facing of the sign. 
# It will also not release whatever craft you previously had piloted. 
# Note that this means multiple such crafts could be launched simultaneously by one pilot. 
# One use of this would be torpedoes.
cruiseOnPilot: false 

# Not Required, defaults to 0. 
# If set to a number ("cruiseSkipBlocks: 4"), then the craft will skip the specified number of blocks when attempting to move the craft forward while cruise is on. 
# The effect is that it moves significantly faster. 
# For large crafts, it is recommended to have a low "speed" and put a number in here to compensate. 
# This helps lower server lag and encourages more realistic forward movement instead of ships that move as quickly in any direction.
cruiseSkipBlocks: 0 

# Not Required, defaults to 0.0. 
# If set to a number (fuelBurnRate: 1.0), then the craft will require fuel loaded into a furnace somewhere on the ship in order to move. 
# It burns coal, charcoal, or blocks of coal based on the number of items the fuel could smelt/process. 
# For example, with fuelBurnRate set to 1.0, a craft could move 8 times from a single piece of coal. 
# With fuelBurnRate set to 0.5, the craft would move 16 times with the same piece of coal. 
# Note that a "move" could be a cruise, which could be skipping blocks. 
# The effect is you may move far more blocks on the same fuel supply if you are cruising than if you are maneuvering.
fuelBurnRate: 0.0 

# Not Required.
# If set, hover type crafts will allow the vehicle to move through the listed blocks. 
# Blocks must be strings, not integers, similar to the following: http:jd.bukkit.org/rb/apidocs/org/bukkit/Material.html 
# Typically this would be set to grass or flowers so your ground vehicles are not obstructed by them.
harvestBlocks: 

# Not Required. 
# If set, (hoverLimit: 0) it will control how high a craft can hover above the terrain. 
# 0 is an acceptable value, and would be appropriate for cars or trains. 
# There are performance implications to setting this too high, so a small number is recommended. 
hoverLimit: 

# Not Required, defaults to not having a limit. 
# This specifies the maximum height the craft can operate at. 
# For water based craft, you may want to set this to just above the ocean level of 62. 
# Note that you don't have to, and a submersible or surface ship can actually fly if you set this high enough. 
# Many users report experiencing extra server lag as airships fly higher. 
# You may want to limit this accordingly.
maxHeightLimit: 

# Not Required, defaults to having no limit. 
# This indicates the furthest distance that can be traveled with a single click of a Move: or Rmove: sign. 
# This is to prevent abuse of the static movement system.
maxStaticMove: 

# Not Required, defaults to having no limit. 
# This specifies the minimum height the craft can operate at. 
# For water surface ships, you may want to set this to just below the ocean level of 62. 
# Note that it does not check this limit unless you actually try to move up or down, so surface ships can operate at high altitude lakes if desired without changing this value. 
# Submarines should have this value set low or not set at all so that they can dive below the water.
minHeightLimit: 

# Not Required, defaults to true. 
# If set (moveEntities: false), the craft will not move entities on top of it. 
# This is usually used for weapons like torpedoes or rockets.
moveEntities: true 

# Not Required, defaults to 0.0. 
# If set to a number (sinkPercent: 90.0), then if the craft drops below that percent of its required flyblocks, then it will begin to sink. 
# Usually this is due to damage by fire or explosives from enemy ships. 
# Once the ship starts sinking, it will sink through air and water until it hits bottom.
sinkPercent: 0.0 

# Not Required, defaults to 0. 
# If set, the watercraft system will always use the indicated water level when it fills in water behind the ship. 
# The default behavior is for the system to scan the nearby terrain and determine the water level from that.
staticWaterLevel: 0 

# Not Required, defaults to false. 
# If set, the vehicle will fall as it moves until it reaches its hoverLimit above the terrain. 
# It will also cause any craft above its maxHeightLimit to fall. 
# This can be used, among other things, to make torpedoes that can be dropped from aircraft and run underwater.
useGravity: false 

Permissions

Movecraft uses the following permissions:

movecraft.<craft name>.pilot
movecraft.<craft name>.move
movecraft.<craft name>.rotate

For example, if you have a craft named "Airship", you would need movecraft.Airship.pilot, movecraft.Airship.move, and movecraft.Airship.rotate in order to completely use it.