Skip to content

Commit

Permalink
Merge branch 'EngineHub:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Anon8281 authored Jul 21, 2023
2 parents bcc3ed1 + b3ee84d commit 5bcd57f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public boolean harvestable(Block block) {
case MELON:
case PUMPKIN:
return true;
case BAMBOO:
return below == Material.BAMBOO;
default:
return Tag.LOGS.isTagged(block.getType());
}
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/com/sk89q/craftbook/util/BlockSyntax.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public class BlockSyntax {

private static Set<String> knownBadLines = new HashSet<>();

private static boolean matchLegacyMaterials = false;

static {
BLOCK_CONTEXT.setPreferringWildcard(true);
BLOCK_CONTEXT.setRestricted(false);
Expand All @@ -63,7 +65,10 @@ public static BaseBlock getBlock(String line, boolean wild) {

if (blockState == null) {
String[] dataSplit = RegexUtil.COLON_PATTERN.split(line.replace("\\:", ":"), 2);
Material material = Material.getMaterial(dataSplit[0], true);
Material material = Material.getMaterial(dataSplit[0], matchLegacyMaterials);
if (material == null && !matchLegacyMaterials) {
material = Material.getMaterial(dataSplit[0], matchLegacyMaterials = true);
}
if (material != null) {
int data = 0;
if (dataSplit.length > 1) {
Expand Down

0 comments on commit 5bcd57f

Please sign in to comment.