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

[CI skip] Reduced technical debt

This commit is contained in:
TheBusyBiscuit 2021-08-01 14:24:52 +02:00
parent 157890aebe
commit 707b219e18
3 changed files with 20 additions and 15 deletions

View File

@ -23,6 +23,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
import io.github.thebusybiscuit.slimefun4.implementation.items.magical.staves.StormStaff;
import io.github.thebusybiscuit.slimefun4.utils.LoreBuilder;
import io.github.thebusybiscuit.slimefun4.utils.PatternUtils;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
@ -44,7 +45,7 @@ public abstract class LimitedUseItem extends SimpleSlimefunItem<ItemUseHandler>
private int maxUseCount = -1;
@ParametersAreNonnullByDefault
public LimitedUseItem(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
protected LimitedUseItem(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
super(category, item, recipeType, recipe);
addItemHandler(getItemHandler());
@ -63,7 +64,9 @@ public abstract class LimitedUseItem extends SimpleSlimefunItem<ItemUseHandler>
* Sets the maximum number of times this item can be used.
* The number must be greater than zero.
*
* @param count The maximum number of times this item can be used.
* @param count
* The maximum number of times this item can be used.
*
* @return The {@link LimitedUseItem} for chaining of setters
*/
public final @Nonnull LimitedUseItem setMaxUseCount(int count) {

View File

@ -125,8 +125,9 @@ public class IndustrialMiner extends MultiBlockMachine {
}
Random random = ThreadLocalRandom.current();
MinecraftVersion version = SlimefunPlugin.getMinecraftVersion();
if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) {
if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_17)) {
// In 1.17, breaking metal ores should get raw metals. Also support deepslate ores.
switch (ore) {
case DEEPSLATE_COAL_ORE:
@ -148,13 +149,14 @@ public class IndustrialMiner extends MultiBlockMachine {
case GOLD_ORE:
case DEEPSLATE_GOLD_ORE:
return new ItemStack(Material.RAW_GOLD);
default:
break;
}
}
if (SlimefunPlugin.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_16)) {
// In 1.16, breaking nether gold ores should get gold nuggets
if (ore == Material.NETHER_GOLD_ORE) {
return new ItemStack(Material.GOLD_NUGGET, 2 + random.nextInt(4));
}
// In 1.16, breaking nether gold ores should get gold nuggets
if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_16) && ore == Material.NETHER_GOLD_ORE) {
return new ItemStack(Material.GOLD_NUGGET, 2 + random.nextInt(4));
}
switch (ore) {

View File

@ -25,18 +25,18 @@ import net.imprex.orebfuscator.api.OrebfuscatorService;
* @author NgLoader
*
*/
public class OrebfuscatorIntegration implements Listener {
class OrebfuscatorIntegration implements Listener {
private final SlimefunPlugin plugin;
private OrebfuscatorService service;
private final SlimefunPlugin plugin;
private OrebfuscatorService service;
public OrebfuscatorIntegration(@Nonnull SlimefunPlugin plugin) {
OrebfuscatorIntegration(@Nonnull SlimefunPlugin plugin) {
this.plugin = plugin;
}
/**
* Init orebfuscation service and register listener
*/
/**
* Init orebfuscation service and register listener
*/
public void register() {
this.service = Bukkit.getServer().getServicesManager().getRegistration(OrebfuscatorService.class).getProvider();