Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to mc 1.14 #201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<source>1.8</source>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there so much space?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Messed up formatting it seems, not sure. Any ideas for the freestanding signs?

1.14 works well so far, since i'm running it on 1.14 and the very long deprecated getData() methods are now finally removed. So it needs to be changed for the future.

<target>1.8</target>
</configuration>
</plugin>
Expand Down Expand Up @@ -87,7 +87,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.13-R0.1-SNAPSHOT</version>
<version>1.14-R0.1-SNAPSHOT</version>
<classifier>shaded</classifier>
<scope>provided</scope>
</dependency>
Expand Down
16 changes: 9 additions & 7 deletions src/main/java/org/gestern/gringotts/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.Sign;
import org.bukkit.block.data.type.WallSign;
import org.gestern.gringotts.currency.GringottsCurrency;

public class Util {
Expand Down Expand Up @@ -92,20 +93,20 @@ public static String format(double value) {
public static Block chestBlock(Sign sign) {
// is sign attached to a valid vault container?
Block signBlock = sign.getBlock();
org.bukkit.material.Sign signData = (org.bukkit.material.Sign) signBlock.getState().getData();
BlockFace attached = signData.getAttachedFace();

WallSign signData = (WallSign) signBlock.getState().getBlockData();
BlockFace attached = signData.getFacing().getOppositeFace();
// allow either the block sign is attached to or the block below the sign as chest block. Prefer attached block.
Block blockAttached = signBlock.getRelative(attached);
Block blockBelow = signBlock.getRelative(BlockFace.DOWN);
// Block blockBelow = signBlock.getRelative(BlockFace.DOWN);

if (validContainer(blockAttached.getType())) {
return blockAttached;
}

if (validContainer(blockBelow.getType())) {
return blockBelow;
}
// if (validContainer(blockBelow.getType())) {
// return blockBelow;
// }

return null; // no valid container
}
Expand All @@ -124,6 +125,7 @@ public static boolean validContainer(Material material) {
case FURNACE:
case HOPPER:
case DROPPER:
case BARREL:
return true;
default:
return false;
Expand Down