3333import static org .bukkit .block .BlockFace .*;
3434import org .bukkit .event .block .BlockRedstoneEvent ;
3535
36- import static org .reliqcraft .Directions .*;
37-
3836/**
3937 *
4038 * @author pepijn
@@ -132,14 +130,13 @@ public void onBlockRedstoneChange(final BlockRedstoneEvent event) {
132130 }
133131
134132 private Portcullis findPortcullisInDirection (final Block block , final BlockFace direction ) {
135- final BlockFace actualDirection = actual (direction );
136- final Block powerBlock = block .getRelative (actualDirection );
133+ final Block powerBlock = block .getRelative (direction );
137134 final Material powerBlockType = powerBlock .getBlockData ().getMaterial ();
138135 if (isPotentialPowerBlock (powerBlockType )) {
139136 if (logger .isLoggable (Level .FINE )) {
140137 logger .fine ("[PorteCoulissante] Potential power block found (type: " + powerBlockType + ")" );
141138 }
142- final Block firstPortcullisBlock = powerBlock .getRelative (actualDirection );
139+ final Block firstPortcullisBlock = powerBlock .getRelative (direction );
143140 if (isPotentialPortcullisBlock (firstPortcullisBlock )) {
144141 final Material portcullisType = firstPortcullisBlock .getBlockData ().getMaterial ();
145142 if (logger .isLoggable (Level .FINE )) {
@@ -152,14 +149,14 @@ private Portcullis findPortcullisInDirection(final Block block, final BlockFace
152149 }
153150 return null ;
154151 }
155- Block lastPortCullisBlock = firstPortcullisBlock .getRelative (actualDirection );
152+ Block lastPortCullisBlock = firstPortcullisBlock .getRelative (direction );
156153 if (isPortcullisBlock (portcullisType ,lastPortCullisBlock )) {
157154 int width = 2 ;
158- Block nextBlock = lastPortCullisBlock .getRelative (actualDirection );
155+ Block nextBlock = lastPortCullisBlock .getRelative (direction );
159156 while (isPortcullisBlock (portcullisType , nextBlock )) {
160157 width ++;
161158 lastPortCullisBlock = nextBlock ;
162- nextBlock = lastPortCullisBlock .getRelative (actualDirection );
159+ nextBlock = lastPortCullisBlock .getRelative (direction );
163160 }
164161 // At least two fences found in a row. Now search up and down
165162 int highestY = firstPortcullisBlock .getLocation ().getBlockY ();
@@ -190,8 +187,8 @@ private Portcullis findPortcullisInDirection(final Block block, final BlockFace
190187 if ((((i == -1 ) || (i == width )) && (dy != -1 ) && (dy != height ))
191188 || (((dy == -1 ) || (dy == height )) && (i != -1 ) && (i != width ))) {
192189 // This is one of the blocks to the sides or above or below of the portcullis
193- final Block frameBlock = world .getBlockAt (x + i * actualDirection .getModX (), y + dy ,
194- z + i * actualDirection .getModZ ());
190+ final Block frameBlock = world .getBlockAt (x + i * direction .getModX (), y + dy ,
191+ z + i * direction .getModZ ());
195192 if (isPortcullisBlock (portcullisType , frameBlock )) {
196193 if (logger .isLoggable (Level .FINE )) {
197194 logger .fine (
@@ -201,8 +198,8 @@ private Portcullis findPortcullisInDirection(final Block block, final BlockFace
201198 }
202199 } else if ((i >= 0 ) && (i < width ) && (dy >= 0 ) && (dy < height )) {
203200 // This is a portcullis block
204- final Block portcullisBlock = world .getBlockAt (x + i * actualDirection .getModX (),
205- y + dy , z + i * actualDirection .getModZ ());
201+ final Block portcullisBlock = world .getBlockAt (x + i * direction .getModX (),
202+ y + dy , z + i * direction .getModZ ());
206203 if (!isPortcullisBlock (portcullisType , portcullisBlock )) {
207204 if (logger .isLoggable (Level .FINE )) {
208205 logger .fine ("[PorteCoulissante] Block of wrong type ("
0 commit comments