Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
StarWishsama committed May 19, 2022
2 parents 4294d76 + 94fd1aa commit 9d0c0b8
Show file tree
Hide file tree
Showing 28 changed files with 175 additions and 560 deletions.
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>7.3.0</version>
<version>8.0.0</version>
</extension>

</extensions>
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,18 @@
## Release Candidate 32 (TBD)

#### Additions
* Added Organic Food for Seagrass
* Added Organic Fertilizer for Seagrass

#### Changes
* Removed support for ChestTerminal

#### Fixes
* Fixed #3445
* Fixed #3504
* Fixed #3534
* Fixed #3538
* Fixed #3548

## Release Candidate 31 (14 Mar 2022)
https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#31
Expand Down
3 changes: 3 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
before_install:
- wget https://github.com/sormuras/bach/raw/master/install-jdk.sh
- source ./install-jdk.sh --feature 17 --license GPL
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
<dependency>
<groupId>com.konghq</groupId>
<artifactId>unirest-java</artifactId>
<version>3.13.7</version>
<version>3.13.8</version>
<scope>compile</scope>

<exclusions>
Expand All @@ -267,7 +267,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.4.0</version>
<version>4.5.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -318,7 +318,7 @@
<dependency>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>2.1.211</version>
<version>2.1.212</version>
<scope>provided</scope>

<exclusions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,46 @@
import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand;
import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.chat.hover.content.Text;
import org.bukkit.Material;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

import javax.annotation.Nonnull;

class ItemIdCommand extends SubCommand {
protected ItemIdCommand(Slimefun plugin, SlimefunCommand cmd) {
super(plugin, cmd, "id", false);
}

@Override
public void onExecute(CommandSender sender, String[] args) {
public void onExecute(@Nonnull CommandSender sender, @Nonnull String[] args) {
if (sender instanceof Player) {
if (sender.hasPermission("slimefun.command.id")) {
Player p = (Player) sender;
ItemStack item = p.getInventory().getItemInMainHand();
if (item.getType() != Material.AIR) {
SlimefunItem sfItem = SlimefunItem.getByItem(item);
if (sfItem != null) {
sender.sendMessage(ChatColors.color("The item's id: " + sfItem.getId()));
String sfId = sfItem.getId();
TextComponent msg = new TextComponent("该物品的ID为: ");
TextComponent idMsg = new TextComponent(sfId);
idMsg.setUnderlined(true);
idMsg.setItalic(true);
idMsg.setColor(ChatColor.GRAY);
idMsg.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("点击复制到剪贴板")));
idMsg.setClickEvent(new ClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, sfId));
sender.spigot().sendMessage(msg, idMsg);
} else {
Slimefun.getLocalization().sendMessage(sender, "messages.not-valid-item", true);
Slimefun.getLocalization().sendMessage(sender, "messages.invalid-item-in-hand", true);
}
} else {
sender.sendMessage(ChatColors.color("&bYou have nothing in your main hand!"));
sender.sendMessage(ChatColors.color("&b请将需要查看的物品拿在主手!"));
}
} else {
Slimefun.getLocalization().sendMessage(sender, "messages.no-permission", true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,11 @@ public void updateProgressBar(@Nonnull BlockMenu inv, int slot, @Nonnull T opera
// Update the progress bar in our inventory (if anyone is watching)
int remainingTicks = operation.getRemainingTicks();
int totalTicks = operation.getTotalTicks();
ChestMenuUtils.updateProgressbar(inv, slot, remainingTicks, totalTicks, getProgressBar());

// Fixes #3538 - If the operation is finished, we don't need to update the progress bar.
if (remainingTicks > 0 || totalTicks > 0) {
ChestMenuUtils.updateProgressbar(inv, slot, remainingTicks, totalTicks, getProgressBar());
}
}

}
Loading

0 comments on commit 9d0c0b8

Please sign in to comment.