Skip to content

Commit

Permalink
Fixed malfunctioning cruise and speed signs
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikh1996 committed Apr 3, 2021
1 parent b4b490c commit 811ebc7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/Movecraft/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>net.countercraft</groupId>
<artifactId>movecraft</artifactId>
<name>Movecraft</name>
<version>7.0.0_for_1.8.8-1.16.2</version>
<version>7.0.0.1_for_1.8.8-1.16.2</version>
<url>http://github.com/apdevteam/Movecraft</url>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
Expand Down
2 changes: 1 addition & 1 deletion modules/Movecraft/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<!--<version>7.0.0</version>-->
<version>7.0.0_for_1.8.8-1.16.2</version>
<version>7.0.0.1_for_1.8.8-1.16.2</version>

<repositories>
<repository>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.bukkit.ChatColor;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
Expand Down Expand Up @@ -52,7 +51,7 @@ public final void onSignClick(PlayerInteractEvent event) {
Sign sign = (Sign) event.getClickedBlock().getState();
Craft c = CraftManager.getInstance().getCraftByPlayer(event.getPlayer());
if (ChatColor.stripColor(sign.getLine(0)).equalsIgnoreCase("Cruise: OFF")) {
if (CraftManager.getInstance().getCraftByPlayer(event.getPlayer()) == null) {
if (c == null) {
return;
}

Expand All @@ -65,7 +64,7 @@ public final void onSignClick(PlayerInteractEvent event) {
sign.update(true);

org.bukkit.material.Sign materialSign = (org.bukkit.material.Sign) block.getState().getData();
if(block.getType().name().endsWith("SIGN") || block.getType() == LegacyUtils.SIGN_POST)
if(!block.getType().name().endsWith("SIGN") && block.getType() != LegacyUtils.SIGN_POST)
c.setCruiseDirection(CruiseDirection.NONE);
else
c.setCruiseDirection(CruiseDirection.fromBlockFace(materialSign.getFacing()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void onSideClick(PlayerInteractEvent event) {
return;
}
Block block = event.getClickedBlock();
if (block == null || block.getType().name().endsWith("SIGN") || block.getType().name().startsWith("SIGN_")) {
if (block == null || !(block.getType().name().endsWith("SIGN") || block.getType().name().startsWith("SIGN_"))) {
return;
}
Sign sign = (Sign) event.getClickedBlock().getState();
Expand Down

0 comments on commit 811ebc7

Please sign in to comment.