Skip to content

Commit

Permalink
v.3.3.2
Browse files Browse the repository at this point in the history
- Implement setDoorBlock glass pane bugfix by @Mineshafter61

Note: Forgot to mention, implemented some fixes by @WolvHaven in v3.3.1! Thanks for the forks guys
  • Loading branch information
Pecacheu committed Mar 16, 2022
1 parent a3d9a35 commit f0f88e0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>net.forestfire</groupId>
<artifactId>Elevators</artifactId>
<version>3.3.1</version>
<version>3.3.2</version>
<packaging>jar</packaging>

<name>Elevators</name>
Expand Down
13 changes: 12 additions & 1 deletion src/main/java/net/forestfire/elevators/Conf.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.bukkit.block.BlockFace;
import org.bukkit.block.Sign;
import org.bukkit.block.data.Bisected;
import org.bukkit.block.data.MultipleFacing;
import org.bukkit.block.data.Openable;
import org.bukkit.block.data.type.*;
import org.bukkit.command.CommandSender;
Expand Down Expand Up @@ -282,7 +283,17 @@ public static Block getSignBlock(Block s) {
public static void addSignBlock(Block s) {
Block b = Conf.getSignBlock(s); if(!b.getType().isSolid()) setDoorBlock(b,true);
}
public static void setDoorBlock(Block b, boolean on) { b.setType(on?Conf.DOOR_SET:Conf.AIR); }
public static void setDoorBlock(Block b, boolean on) {
b.setType(on?Conf.DOOR_SET:Conf.AIR);
if(on && b.getBlockData() instanceof MultipleFacing) { //Connect block faces
MultipleFacing f=(MultipleFacing)b.getBlockData(); Location l=b.getLocation();
f.setFace(BlockFace.EAST, !l.clone().add(1,0,0).getBlock().isEmpty());
f.setFace(BlockFace.WEST, !l.clone().add(-1,0,0).getBlock().isEmpty());
f.setFace(BlockFace.NORTH, !l.clone().add(0,0,-1).getBlock().isEmpty());
f.setFace(BlockFace.SOUTH, !l.clone().add(0,0,1).getBlock().isEmpty());
b.setBlockData(f);
}
}

//Determine if sign or call sign was clicked on:
public static boolean isElevSign(Block b, ConfData ref, Player pl, String perm) {
Expand Down

0 comments on commit f0f88e0

Please sign in to comment.