-
Notifications
You must be signed in to change notification settings - Fork 8
Home
Plugin allows to create retractable bridges and gates.
Supports Citadel, Bastion and JukeAlert plugins.
- How to create basic bridge
- Behavior
- Interaction with Citadel plugin
- Interaction with Bastion plugin
- Interaction with JukeAlert plugin
- Commands
- Installation
- Put two opposite blocks
- Left click first block with gold ingot - ingot consumed and gearblock registered
- Left click second block with gold ingot - ingot consumed, gearblock registered and link with first gearblock is created
- Put blocks between gearblocks
- Put stone button to one of gearblocks
Now when you activate button - bridge will be drawn. Activate it one more time - bridge will be undrawn.
Simple bridge: https://youtu.be/RCpiQysWPTU
Advanced bridge: https://youtu.be/HyUKJfbJeP4
Gates: https://youtu.be/-2Zu8b-rgPc
Trap: https://youtu.be/vVHN2fF5sFo
Lockable vertical entrance: https://youtu.be/AyYhgpD6IJk
When player is left clicking block by gold ingot - plugin is trying to register gearblock.
Gearblock could be registered only if such block type is allowed in config file.
After gearblock is created - plugin is trying to create link and therefore searching opposite gearblock (already registered) for one of block faces.
If such block is found then link will be created.
Following conditions should be meet to allow to create link between gearblocks:
- Space between two gearblocks should be at least 1 block
- It is not possible to create link if between two gearblock is located another gearblock
- Max space between two gearblocks is 16 blocks (could be changed in config file)
Sometimes automatically created link is not what player wanted.
In this case link could be removed using /cg link command and new link could be created with this command too.
When gearblock's 'redstone power state' is changing from non-powered to powered then plugin is trying to change link's state.
If link is in undrawn state - then plugin is trying to draw bridge, if link is in drawn state - then plugin is trying undraw bridge.
Bridge (i.e. blocks between linked gearblocks) will be drawn only if all bridge blocks are not AIR and are in config's list of allowed blocks.
For example by default obsidian is not considered as allowed block for bridge but allowed for gearblock.
Bridge will be undrawn only if all blocks between linked gearblocks are AIR.
If two gearblocks are adjacent then if one of blocks is powered/unpowered - then state change will be transferred to adjacent block.
If second block has another adjacent block - it will be powered/unpowered as well.
Max number of 'transfers' from initial gearblock is 8 (could be changed in config file)
This simplify creation of bridge/gates which is consisting with more than one link (for example bridge 5 blocks wide with fences on the sides).
Lets suppose situation:
- Two gearblocks are linked
- Link is in drawn state
- Someone is breaking one of gearblocks
In this case link could be restored if player will put new gearblock instead of broken.
If both gearblocks are broken - then such link could not be restored and bridge blocks are lost.
Starting from version 1.0.10 was introduced new function Timer. It allows automatically to activate gearblock after some time after player activated it. This could be useful for example to close gates after some time when player entered castle or recharge trap without complicated redstone schema.
For enabling timer is used following command: /cg timer.
Player should enter command and then left click to the gearblock.
Repeated click will remove timer.
It is enough to apply timer only to one "activating" gearblock - on activation it will spread timer function together with signal to adjacent gearblocks.
Timer will be activated once gearblock is activated (exclusion is DOOR mode)
For more details look at the Commands section
DOOR mode could be used to activate timer once gearblock is deactivated i.e. redstone signal is off. This is useful to simulate behavior of doors activated by pressure plates.
When gearblock is powered then this gearblock (let's name it "lock gearblock"), gearblocks to where power was transferred and it's links are marked as locked.
When gearblock or link is locked it cannot be activated and change state.
Gearblocks and links are becoming unlocked either when "lock gearblock" is unpowered or if one or more gearblocks in "locked gearblocks list" were changed (block broken or link deleted).
This feature could be especially useful when CastleGates is using together with Citadel plugin and player want to prevent other unwanted player to open gates using "redstone proximity" (look at rule 1 of Citadel integration description)
When construction consists of only two gearblocks and bridge blocks between them - then it could be opened by right clicking to bridge block.
If Citadel plugin is installed then following rules are applied:
- Bridge/gates could be drawn only if any player within radius 7 blocks (could be changed in Citadel's plugin) from gearblock which was powered:
- Has DOORS permission on all gearblocks of the bridge and ALL gearblocks reinforced by the same group
- Has DOORS permission on all bridge blocks (i.e. blocks between gearblocks) and ALL bridge blocks reinforced by the same group as gearblock
- Bridge/gates could be undrawn if any player within radius 7 blocks (could be changed in Citadel's plugin) from gearblock which was powered:
- Has DOORS access on all gearblocks of the bridge and ALL gearblocks have the same group
After bridge undrawn - all bridge blocks will have the same reinforcements as before drawing (i.e. reinforcement is not lost)
By default gearblock could be created for non-reinforced block.
But if config option "Settings.GearblockMustBeReinforced" set to "true" then block must be reinforced before it could be marked as gearblock.
If Bastion plugin is installed then following rules are applied:
- Bridge/gates could be undrawn if any player within radius 7 blocks (could be changed via config) from gearblock which was powered:
- Either has BASTION_BRIDGE_UNDRAW permission in bastion group if bridge's AIR blocks are located in bastioned area.
- Or bridge/gates construction was reinforced by group which was added to bastion group as "allowed"
BASTION_BRIDGE_UNDRAW permission by default is granted to MEMBERS.
If level triggering is enabled for JukeAlert (by command /jaToggleLevers 1) then such JukeAlert could allow for reinforced gearblock to be activated when following conditions are meet:
-
JukeAlert is reinforced by the same group as gearblock
-
JukeAlert is located in 7 block distance from gearblock (could be changed in Citadel's plugin)
This allows to build traps for reinforced bridges, for example: https://youtu.be/YnK38FEC9Io
New timer function allows to recharge trap without complicated redstone schema.
The same rule is working for bastions.
Command | Description |
---|---|
/cg create, /gear | Left click with stick to the block - gold ingot will be consumed and block will be registered as gearblock |
/cg link, /link | Left click with stick to the non-linked gearblock - will try to create link with the gearblock opposite to clicked block face. If left clicked linked gearblock - it will remove link |
/cg timer | Parameters: [<period in seconds> [draw | undraw | revert ]] [door] Left click to the gearblock will set or remove timer. For example: /cg timer 5 DRAW. By default period in seconds = 5 and operation = UNDRAW (default values could be changed in config) Operation could have one of the following values: - DRAW - bridge/gates will be drawn when timer activates. If it is already in drawn state - then operation ignored. - UNDRAW - bridge/gates will be undrawn when timer activates. - REVERT - bridge/gates state will be reverted when timer activates. When used DOOR mode then timer will be activated after gearblock unpowered. When used command /cg timer door then will be used period in seconds = 1 and operation = UNDRAW |
/cg info | Left click to the block will show if this is gearblock or bridge block |
/cg reload | Reloads all gearblocks and links and restart helper threads. Could be used only from server's console |
- Copy CastleGates jar to plugins folder and start server
- After server enabled - stop it (you will see in logs error that plugin cannot connect to database)
- Go to config file and enter correct database connection settings
- Start server again
Plugin is creating four tables:
- cg_gearblock - storing list of gearblocks
- cg_link - storing list of links
- cg_reinforcement - storing reinforcements' info for drawn blocks
- cg_patch - information about patches