1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Merge branch 'Slimefun:master' into master

This commit is contained in:
EpicPlayerA10 2021-07-12 11:22:42 +02:00 committed by GitHub
commit 881beebacf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 11 deletions

View File

@ -34,6 +34,8 @@
* Tridents can now be crafted * Tridents can now be crafted
* The Industrial Miner can now mine up to the minimum world limit (previously only until y=0) * The Industrial Miner can now mine up to the minimum world limit (previously only until y=0)
* (API) Added SlimefunItemSpawnEvent and ItemSpawnReason * (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 #### Changes

View File

@ -355,7 +355,7 @@
<dependency> <dependency>
<groupId>com.github.seeseemelk</groupId> <groupId>com.github.seeseemelk</groupId>
<artifactId>MockBukkit-v1.16</artifactId> <artifactId>MockBukkit-v1.16</artifactId>
<version>1.3.2</version> <version>1.5.0</version>
<scope>test</scope> <scope>test</scope>
<exclusions> <exclusions>
@ -442,7 +442,7 @@
<dependency> <dependency>
<groupId>me.clip</groupId> <groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId> <artifactId>placeholderapi</artifactId>
<version>2.10.9</version> <version>2.10.10</version>
<scope>provided</scope> <scope>provided</scope>
<exclusions> <exclusions>

View File

@ -75,6 +75,7 @@ class ContributionsConnector extends GitHubConnector {
aliases.put("ramdon-person", "ramdon_person"); aliases.put("ramdon-person", "ramdon_person");
aliases.put("NCBPFluffyBear", "FluffyBear_"); aliases.put("NCBPFluffyBear", "FluffyBear_");
aliases.put("martinbrom", "OneTime97"); aliases.put("martinbrom", "OneTime97");
aliases.put("LilBC", "Lil_BC");
} }
/** /**
@ -134,4 +135,4 @@ class ContributionsConnector extends GitHubConnector {
} }
} }
} }
} }

View File

@ -6,6 +6,7 @@ import java.util.stream.Collectors;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault; import javax.annotation.ParametersAreNonnullByDefault;
import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -80,6 +81,11 @@ public class GrindStone extends MultiBlockMachine {
recipes.add(new ItemStack(Material.QUARTZ_BLOCK)); recipes.add(new ItemStack(Material.QUARTZ_BLOCK));
recipes.add(new ItemStack(Material.QUARTZ, 4)); 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(SlimefunItems.MAGIC_LUMP_2);
recipes.add(new SlimefunItemStack(SlimefunItems.MAGIC_LUMP_1, 4)); recipes.add(new SlimefunItemStack(SlimefunItems.MAGIC_LUMP_1, 4));

View File

@ -52,6 +52,7 @@ public class IndustrialMiner extends MultiBlockMachine {
protected final List<MachineFuel> fuelTypes = new ArrayList<>(); protected final List<MachineFuel> fuelTypes = new ArrayList<>();
private final ItemSetting<Boolean> canMineAncientDebris = new ItemSetting<>(this, "can-mine-ancient-debris", false); 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 boolean silkTouch;
private final int range; private final int range;
@ -64,6 +65,7 @@ public class IndustrialMiner extends MultiBlockMachine {
registerDefaultFuelTypes(); registerDefaultFuelTypes();
addItemSetting(canMineAncientDebris); addItemSetting(canMineAncientDebris);
addItemSetting(canMineDeepslateOres);
} }
/** /**
@ -159,12 +161,12 @@ public class IndustrialMiner extends MultiBlockMachine {
} }
@Override @Override
public String getLabelLocalPath() { public @Nonnull String getLabelLocalPath() {
return "guide.tooltips.recipes.generator"; return "guide.tooltips.recipes.generator";
} }
@Override @Override
public List<ItemStack> getDisplayRecipes() { public @Nonnull List<ItemStack> getDisplayRecipes() {
List<ItemStack> list = new ArrayList<>(); List<ItemStack> list = new ArrayList<>();
for (MachineFuel fuel : fuelTypes) { for (MachineFuel fuel : fuelTypes) {
@ -217,14 +219,16 @@ public class IndustrialMiner extends MultiBlockMachine {
* @return Whether this {@link IndustrialMiner} is capable of mining this {@link Material} * @return Whether this {@link IndustrialMiner} is capable of mining this {@link Material}
*/ */
public boolean canMine(@Nonnull Material type) { public boolean canMine(@Nonnull Material type) {
if (SlimefunTag.INDUSTRIAL_MINER_ORES.isTagged(type)) { MinecraftVersion version = SlimefunPlugin.getMinecraftVersion();
return true; if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_16) && type == Material.ANCIENT_DEBRIS) {
} else if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) { return canMineAncientDebris.getValue();
return type == Material.ANCIENT_DEBRIS && canMineAncientDebris.getValue();
} }
return false; if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_17) && SlimefunTag.DEEPSLATE_ORES.isTagged(type)) {
return canMineDeepslateOres.getValue();
}
return SlimefunTag.INDUSTRIAL_MINER_ORES.isTagged(type);
} }
} }