Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/ren/natsuyuk1/slimefunextra/IntegrationHelper.java
  • Loading branch information
StarWishsama committed Dec 16, 2022
2 parents 877a548 + b6fa180 commit 3b9de85
Show file tree
Hide file tree
Showing 35 changed files with 349 additions and 349 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ on:
- '.github/workflows/**'
- 'src/**'
- 'pom.xml'
workflow_dispatch:

jobs:
build:
if: contains(github.event.head_commit.message, '✨') == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<extension>
<groupId>me.qoomon</groupId>
<artifactId>maven-git-versioning-extension</artifactId>
<version>9.0.1</version>
<version>9.3.0</version>
</extension>

</extensions>
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,25 @@
* (API) Added a method for item groups to allow addons to choose if they want to allow items from other addons
* Added a new option to Eletric Gold Pans: "override-output-limit"
* Added "Mud -> Clay" recipe to the Auto Drier
* Added a third tier for Freezers
* Added Glow Berry Juice

#### Changes
* Tree Growth Accelerators can now actually cause the Tree to fully grow (1.17+ only)
* Slimefun now requires Java 16
* "Connected / Not connected" messages for cargo nodes are now sent via the actionbar
* "/sf stats" can no longer be used if researching is disabled
* "/sf research" can no longer be used if researching is disabled
* Removed the Hercules Pickaxe from Slimefun

#### Fixes
* Fixed #3597
* Fixed an issue related to "Bee Wings"
* Fixed #3573
* Fixed "round-robin" mode for cargo networks being very unreliable
* Fixed #3664
* Fixed #3651
* Fixed #3677

## Release Candidate 32 (26 Jun 2022)
https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#32
Expand Down
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<!-- Dependency shading -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.0</version>

<configuration>
<!-- Relocate these to avoid clashes and conflicts -->
Expand Down Expand Up @@ -178,7 +178,7 @@
<!-- Plugin for Unit Tests -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M6</version>
<version>3.0.0-M7</version>

<configuration>
<junitArtifactName>org.junit.jupiter:junit-jupiter</junitArtifactName>
Expand Down Expand Up @@ -254,7 +254,7 @@
<dependency>
<groupId>com.konghq</groupId>
<artifactId>unirest-java</artifactId>
<version>3.13.10</version>
<version>3.13.11</version>
<scope>compile</scope>

<exclusions>
Expand All @@ -270,13 +270,13 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.9.0</version>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.7.0</version>
<version>4.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -369,7 +369,7 @@
<dependency>
<groupId>com.github.LoneDev6</groupId>
<artifactId>itemsadder-api</artifactId>
<version>3.2.3c</version>
<version>3.2.3-r8</version>
<scope>provided</scope>

<exclusions>
Expand All @@ -383,7 +383,7 @@
<dependency>
<groupId>net.imprex</groupId>
<artifactId>orebfuscator-api</artifactId>
<version>5.2.6</version>
<version>5.3.0</version>
<scope>provided</scope>
<exclusions>
<exclusion>
Expand Down Expand Up @@ -424,7 +424,7 @@
<dependency>
<groupId>org.maxgamer</groupId>
<artifactId>QuickShop</artifactId>
<version>5.1.0.7</version>
<version>5.1.0.9</version>
<scope>provided</scope>
<exclusions>
<exclusion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public boolean onClick(InventoryClickEvent e, Player p, int slot, ItemStack curs
@Override
public boolean canOpen(@Nonnull Block b, @Nonnull Player p) {
return p.hasPermission("slimefun.inventory.bypass")
|| (Slimefun.getProtectionManager().hasPermission(p,b.getLocation(), Interaction.INTERACT_BLOCK) && IntegrationHelper.checkPermission(p, b, Interaction.INTERACT_BLOCK));
|| (Slimefun.getProtectionManager().hasPermission(p, b.getLocation(), Interaction.INTERACT_BLOCK) && IntegrationHelper.checkResidence(p, b, Interaction.INTERACT_BLOCK));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class RecipeType implements Keyed {

public static final RecipeType MOB_DROP = new RecipeType(new NamespacedKey(Slimefun.instance(), "mob_drop"), new CustomItemStack(Material.IRON_SWORD, "&bMob Drop"), RecipeType::registerMobDrop, "", "&rKill the specified Mob to obtain this Item");
public static final RecipeType BARTER_DROP = new RecipeType(new NamespacedKey(Slimefun.instance(), "barter_drop"), new CustomItemStack(Material.GOLD_INGOT, "&bBarter Drop"), RecipeType::registerBarterDrop, "&aBarter with piglins for a chance", "&ato obtain this item");
public static final RecipeType INTERACT = new RecipeType(new NamespacedKey(Slimefun.instance(), "interact"), new CustomItemStack(Material.PLAYER_HEAD, "&bInteract", "", "&a&oRight click with this item"));

public static final RecipeType HEATED_PRESSURE_CHAMBER = new RecipeType(new NamespacedKey(Slimefun.instance(), "heated_pressure_chamber"), SlimefunItems.HEATED_PRESSURE_CHAMBER);
public static final RecipeType FOOD_FABRICATOR = new RecipeType(new NamespacedKey(Slimefun.instance(), "food_fabricator"), SlimefunItems.FOOD_FABRICATOR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ private boolean compareBlocks(Material a, @Nullable Material b) {
public boolean isSymmetric() {
return isSymmetric;
}

@Override
public String toString() {
return "MultiBlock (" + item.getId() + ") {" + Arrays.toString(blocks) + "}";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@
package io.github.thebusybiscuit.slimefun4.core.networks.cargo;

import java.util.Map;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import ren.natsuyuk1.slimefunextra.IntegrationHelper;
import io.github.bakedlibs.dough.inventory.InvUtils;
import io.github.thebusybiscuit.slimefun4.core.debug.Debug;
import io.github.thebusybiscuit.slimefun4.core.debug.TestCase;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Tag;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.inventory.BrewerInventory;
import org.bukkit.inventory.FurnaceInventory;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;

import io.github.bakedlibs.dough.inventory.InvUtils;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils;
import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper;
import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag;
import io.papermc.lib.PaperLib;

import me.mrCookieSlime.Slimefun.api.BlockStorage;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import me.mrCookieSlime.Slimefun.api.inventory.DirtyChestMenu;
import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Tag;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.inventory.*;
import ren.natsuyuk1.slimefunextra.IntegrationHelper;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Map;

/**
* This is a helper class for the {@link CargoNet} which provides
Expand Down Expand Up @@ -393,7 +386,7 @@ static DirtyChestMenu getChestMenu(@Nonnull Block block) {
}

static boolean matchesFilter(@Nonnull AbstractItemNetwork network, @Nonnull Block node, @Nullable ItemStack item) {
if (item == null || item.getType() == Material.AIR || IntegrationHelper.checkForQuickShop(node.getLocation())) {
if (item == null || item.getType() == Material.AIR || IntegrationHelper.checkQuickShop(node.getLocation())) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ private SlimefunItems() {
public static final SlimefunItemStack CARROT_JUICE = new SlimefunItemStack("CARROT_JUICE", Color.ORANGE, new PotionEffect(PotionEffectType.SATURATION, 5, 0), "&6胡萝卜汁", "", LoreBuilder.hunger(3));
public static final SlimefunItemStack PUMPKIN_JUICE = new SlimefunItemStack("PUMPKIN_JUICE", Color.ORANGE, new PotionEffect(PotionEffectType.SATURATION, 5, 0), "&6南瓜汁", "", LoreBuilder.hunger(3));
public static final SlimefunItemStack SWEET_BERRY_JUICE = new SlimefunItemStack("SWEET_BERRY_JUICE", Color.RED, new PotionEffect(PotionEffectType.SATURATION, 5, 0), "&c浆果汁", "", LoreBuilder.hunger(3));
public static final SlimefunItemStack GLOW_BERRY_JUICE = new SlimefunItemStack("GLOW_BERRY_JUICE", Color.ORANGE, new PotionEffect(PotionEffectType.SATURATION, 5, 0), "&6发光浆果汁", "", LoreBuilder.hunger(3));
public static final SlimefunItemStack GOLDEN_APPLE_JUICE = new SlimefunItemStack("GOLDEN_APPLE_JUICE", Color.YELLOW, new PotionEffect(PotionEffectType.ABSORPTION, 20 * 20, 0), "&b金苹果汁");

public static final SlimefunItemStack BEEF_JERKY = new SlimefunItemStack("BEEF_JERKY", Material.COOKED_BEEF, "&6牛肉干", "", "&r横扫饥饿!");
Expand Down Expand Up @@ -202,7 +203,6 @@ private SlimefunItems() {
public static final SlimefunItemStack SMELTERS_PICKAXE = new SlimefunItemStack("SMELTERS_PICKAXE", Material.DIAMOND_PICKAXE, "&6熔炉镐", "&c&l自动熔炼", "", "&9在挖矿时有时运效果");
public static final SlimefunItemStack LUMBER_AXE = new SlimefunItemStack("LUMBER_AXE", Material.DIAMOND_AXE, "&6伐木斧", "&a&o砍倒整棵树木...");
public static final SlimefunItemStack PICKAXE_OF_CONTAINMENT = new SlimefunItemStack("PICKAXE_OF_CONTAINMENT", Material.IRON_PICKAXE, "&c刷怪笼之镐", "", "&9可以获取刷怪笼");
public static final SlimefunItemStack HERCULES_PICKAXE = new SlimefunItemStack("HERCULES_PICKAXE", Material.IRON_PICKAXE, "&9赫拉克勒斯之镐", "", "&4已弃用 - 将在不久后移除", "", "&r它如此强大", "&r因此能自动将挖到的矿物变为粉末...");
public static final SlimefunItemStack EXPLOSIVE_PICKAXE = new SlimefunItemStack("EXPLOSIVE_PICKAXE", Material.DIAMOND_PICKAXE, "&e爆炸稿", "", "&r允许你在一瞬间挖掘矿物", "", "&9在挖矿时有时运效果");
public static final SlimefunItemStack EXPLOSIVE_SHOVEL = new SlimefunItemStack("EXPLOSIVE_SHOVEL", Material.DIAMOND_SHOVEL, "&e爆炸铲", "", "&r让你一下子就能挖掉很多方块");
public static final SlimefunItemStack PICKAXE_OF_THE_SEEKER = new SlimefunItemStack("PICKAXE_OF_THE_SEEKER", Material.DIAMOND_PICKAXE, "&a寻矿稿", "&r使用时将会指出你附近的矿物", "&r但可能它会受到损伤", "", "&7&e右键&7 以寻找四周的矿物");
Expand All @@ -211,9 +211,6 @@ private SlimefunItems() {
public static final SlimefunItemStack CLIMBING_PICK = new SlimefunItemStack("CLIMBING_PICK", Material.IRON_PICKAXE, "&b攀岩镐", "", "&f让你能够在右键后", "&f攀爬到指定平面上.", "&f附魔效率之后攀爬速度将会提升");

static {
HERCULES_PICKAXE.addUnsafeEnchantment(Enchantment.DURABILITY, 5);
HERCULES_PICKAXE.addUnsafeEnchantment(Enchantment.DIG_SPEED, 3);

COBALT_PICKAXE.addUnsafeEnchantment(Enchantment.DURABILITY, 10);
COBALT_PICKAXE.addUnsafeEnchantment(Enchantment.DIG_SPEED, 6);
}
Expand Down Expand Up @@ -522,7 +519,7 @@ private SlimefunItems() {
public static final SlimefunItemStack LEAD_DUST = new SlimefunItemStack("LEAD_DUST", Material.GUNPOWDER, "&6铅粉");
public static final SlimefunItemStack SULFATE = new SlimefunItemStack("SULFATE", Material.GLOWSTONE_DUST, "&6硫酸盐");
public static final SlimefunItemStack ZINC_DUST = new SlimefunItemStack("ZINC_DUST", Material.SUGAR, "&6锌粉");
public static final SlimefunItemStack MAGNESIUM_DUST = new SlimefunItemStack("MAGNESIUM_DUST", Material.SUGAR, "&6镁");
public static final SlimefunItemStack MAGNESIUM_DUST = new SlimefunItemStack("MAGNESIUM_DUST", Material.SUGAR, "&6镁粉");
public static final SlimefunItemStack SILICON = new SlimefunItemStack("SILICON", Material.FIREWORK_STAR, "&6硅");
public static final SlimefunItemStack GOLD_24K_BLOCK = new SlimefunItemStack("GOLD_24K_BLOCK", Material.GOLD_BLOCK, "&r&r金块 &7(24克拉)");

Expand Down Expand Up @@ -836,6 +833,7 @@ private SlimefunItems() {

public static final SlimefunItemStack FREEZER = new SlimefunItemStack("FREEZER", Material.LIGHT_BLUE_STAINED_GLASS, "&b冰箱", "", LoreBuilder.machine(MachineTier.ADVANCED, MachineType.MACHINE), "&8\u21E8 &7速度: 1x", LoreBuilder.powerBuffer(256), LoreBuilder.powerPerSecond(18));
public static final SlimefunItemStack FREEZER_2 = new SlimefunItemStack("FREEZER_2", Material.LIGHT_BLUE_STAINED_GLASS, "&b冰箱 &7(&eII&7)", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), "&8\u21E8 &7速度: 2x", LoreBuilder.powerBuffer(256), LoreBuilder.powerPerSecond(30));
public static final SlimefunItemStack FREEZER_3 = new SlimefunItemStack("FREEZER_3", Material.LIGHT_GRAY_STAINED_GLASS, "&b冰箱 &7(&eIII&7)", "", LoreBuilder.machine(MachineTier.END_GAME, MachineType.MACHINE), LoreBuilder.speed(3), LoreBuilder.powerBuffer(256), LoreBuilder.powerPerSecond(42));

public static final SlimefunItemStack ELECTRIC_GOLD_PAN = new SlimefunItemStack("ELECTRIC_GOLD_PAN", Material.BROWN_TERRACOTTA, "&6电动淘金机", "", LoreBuilder.machine(MachineTier.BASIC, MachineType.MACHINE), "&8\u21E8 &7速度: 1x", LoreBuilder.powerPerSecond(2));
public static final SlimefunItemStack ELECTRIC_GOLD_PAN_2 = new SlimefunItemStack("ELECTRIC_GOLD_PAN_2", Material.BROWN_TERRACOTTA, "&6电动淘金机 &7(&eII&7)", "", LoreBuilder.machine(MachineTier.BASIC, MachineType.MACHINE), "&8\u21E8 &7速度: 3x", LoreBuilder.powerPerSecond(4));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ private void displaySlimefunItem(ChestMenu menu, ItemGroup itemGroup, Player p,
Slimefun.getLocalization().sendMessage(pl, "messages.no-permission", true);
}
} catch (Exception | LinkageError x) {
printErrorMessage(pl, x);
printErrorMessage(pl, sfitem, x);
}

return false;
Expand Down Expand Up @@ -389,7 +389,7 @@ public void openSearch(PlayerProfile profile, String input, boolean addToHistory
displayItem(profile, slimefunItem, true);
}
} catch (Exception | LinkageError x) {
printErrorMessage(pl, x);
printErrorMessage(pl, slimefunItem, x);
}

return false;
Expand Down Expand Up @@ -769,4 +769,10 @@ private void printErrorMessage(Player p, Throwable x) {
Slimefun.logger().log(Level.SEVERE, "在打开指南书里的 Slimefun 物品时发生了意外!", x);
}

@ParametersAreNonnullByDefault
private void printErrorMessage(Player p, SlimefunItem item, Throwable x) {
p.sendMessage(ChatColor.DARK_RED + "An internal server error has occurred. Please inform an admin, check the console for further info.");
item.error("This item has caused an error message to be thrown while viewing it in the Slimefun guide.", x);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package io.github.thebusybiscuit.slimefun4.implementation.items;

import javax.annotation.ParametersAreNonnullByDefault;

import org.bukkit.inventory.ItemStack;

import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
import io.github.thebusybiscuit.slimefun4.core.attributes.NotConfigurable;

/**
* The {@link HiddenItem} is a {@link NotConfigurable} {@link SlimefunItem}
* that is hidden from the Slimefun guide.
*
* @author char321
*
*/
public class HiddenItem extends SlimefunItem implements NotConfigurable {

@ParametersAreNonnullByDefault
public HiddenItem(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
super(itemGroup, item, recipeType, recipe);
this.setHidden(true);
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
package io.github.thebusybiscuit.slimefun4.implementation.items.androids;

import java.util.Collection;
import java.util.UUID;

import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;

import org.bukkit.Bukkit;
import org.bukkit.Effect;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.Particle;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.Container;
import org.bukkit.inventory.ItemStack;

import io.github.bakedlibs.dough.protection.Interaction;
import io.github.thebusybiscuit.slimefun4.api.events.AndroidMineEvent;
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
Expand All @@ -26,9 +9,19 @@
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
import io.github.thebusybiscuit.slimefun4.utils.InfiniteBlockGenerator;
import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag;

import me.mrCookieSlime.Slimefun.api.BlockStorage;
import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.Container;
import org.bukkit.inventory.ItemStack;
import ren.natsuyuk1.slimefunextra.IntegrationHelper;

import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.Collection;
import java.util.UUID;

/**
* The {@link MinerAndroid} is a variant of the {@link ProgrammableAndroid} which
Expand Down Expand Up @@ -80,6 +73,14 @@ protected void dig(Block b, BlockMenu menu, Block block) {
OfflinePlayer owner = Bukkit.getOfflinePlayer(UUID.fromString(BlockStorage.getLocationInfo(b.getLocation(), "owner")));

if (Slimefun.getProtectionManager().hasPermission(owner, block.getLocation(), Interaction.BREAK_BLOCK)) {
if (IntegrationHelper.checkQuickShop(block.getLocation())) {
return;
}

if (!IntegrationHelper.checkResidence(owner, block, Interaction.BREAK_BLOCK)) {
return;
}

AndroidMineEvent event = new AndroidMineEvent(block, new AndroidInstance(this, b));
Bukkit.getPluginManager().callEvent(event);

Expand All @@ -104,6 +105,14 @@ protected void moveAndDig(Block b, BlockMenu menu, BlockFace face, Block block)
OfflinePlayer owner = Bukkit.getOfflinePlayer(UUID.fromString(BlockStorage.getLocationInfo(b.getLocation(), "owner")));

if (Slimefun.getProtectionManager().hasPermission(owner, block.getLocation(), Interaction.BREAK_BLOCK)) {
if (IntegrationHelper.checkQuickShop(block.getLocation())) {
return;
}

if (!IntegrationHelper.checkResidence(owner, block, Interaction.BREAK_BLOCK)) {
return;
}

AndroidMineEvent event = new AndroidMineEvent(block, new AndroidInstance(this, b));
Bukkit.getPluginManager().callEvent(event);

Expand Down
Loading

0 comments on commit 3b9de85

Please sign in to comment.