Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
EpicPlayerA10 committed Jul 12, 2021
2 parents 5bf0b5e + 881beeb commit 35e3b1b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
* Tridents can now be crafted
* The Industrial Miner can now mine up to the minimum world limit (previously only until y=0)
* (API) Added SlimefunItemSpawnEvent and ItemSpawnReason
* Added "Amethyst Block -> 4 Amethyst Shards" recipe to the Grind Stone
* Added an option to the IndustrialMiner to configure if they can mine deepslate ores

#### Changes

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@
<dependency>
<groupId>com.github.seeseemelk</groupId>
<artifactId>MockBukkit-v1.16</artifactId>
<version>1.3.2</version>
<version>1.5.0</version>
<scope>test</scope>

<exclusions>
Expand Down Expand Up @@ -442,7 +442,7 @@
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.10.9</version>
<version>2.10.10</version>
<scope>provided</scope>

<exclusions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ private void loadConfiguration() {
aliases.put("ramdon-person", "ramdon_person");
aliases.put("NCBPFluffyBear", "FluffyBear_");
aliases.put("martinbrom", "OneTime97");
aliases.put("LilBC", "Lil_BC");
}

/**
Expand Down Expand Up @@ -134,4 +135,4 @@ private void computeContributors(@Nonnull JSONArray array) {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;

import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
Expand Down Expand Up @@ -80,6 +81,11 @@ protected void registerDefaultRecipes(@Nonnull List<ItemStack> recipes) {
recipes.add(new ItemStack(Material.QUARTZ_BLOCK));
recipes.add(new ItemStack(Material.QUARTZ, 4));

if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) {
recipes.add(new ItemStack(Material.AMETHYST_BLOCK));
recipes.add(new ItemStack(Material.AMETHYST_SHARD, 4));
}

recipes.add(SlimefunItems.MAGIC_LUMP_2);
recipes.add(new SlimefunItemStack(SlimefunItems.MAGIC_LUMP_1, 4));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public class IndustrialMiner extends MultiBlockMachine {
protected final List<MachineFuel> fuelTypes = new ArrayList<>();

private final ItemSetting<Boolean> canMineAncientDebris = new ItemSetting<>(this, "can-mine-ancient-debris", false);
private final ItemSetting<Boolean> canMineDeepslateOres = new ItemSetting<>(this, "can-mine-deepslate-ores", true);
private final boolean silkTouch;
private final int range;

Expand All @@ -64,6 +65,7 @@ public IndustrialMiner(Category category, SlimefunItemStack item, Material baseM

registerDefaultFuelTypes();
addItemSetting(canMineAncientDebris);
addItemSetting(canMineDeepslateOres);
}

/**
Expand Down Expand Up @@ -159,12 +161,12 @@ public void addFuelType(int ores, @Nonnull ItemStack item) {
}

@Override
public String getLabelLocalPath() {
public @Nonnull String getLabelLocalPath() {
return "guide.tooltips.recipes.generator";
}

@Override
public List<ItemStack> getDisplayRecipes() {
public @Nonnull List<ItemStack> getDisplayRecipes() {
List<ItemStack> list = new ArrayList<>();

for (MachineFuel fuel : fuelTypes) {
Expand Down Expand Up @@ -217,14 +219,16 @@ public void onInteract(Player p, Block b) {
* @return Whether this {@link IndustrialMiner} is capable of mining this {@link Material}
*/
public boolean canMine(@Nonnull Material type) {
if (SlimefunTag.INDUSTRIAL_MINER_ORES.isTagged(type)) {
return true;
} else if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) {
return type == Material.ANCIENT_DEBRIS && canMineAncientDebris.getValue();
MinecraftVersion version = SlimefunPlugin.getMinecraftVersion();
if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_16) && type == Material.ANCIENT_DEBRIS) {
return canMineAncientDebris.getValue();
}

if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_17) && SlimefunTag.DEEPSLATE_ORES.isTagged(type)) {
return canMineDeepslateOres.getValue();
}

return false;
return SlimefunTag.INDUSTRIAL_MINER_ORES.isTagged(type);
}

}

0 comments on commit 35e3b1b

Please sign in to comment.