1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00

Added a new feature to the debug fish

SlimefunTag support
This commit is contained in:
TheBusyBiscuit 2021-06-18 15:08:24 +02:00
parent 80608b1e08
commit 805c2eafcc
2 changed files with 28 additions and 3 deletions

View File

@ -1,5 +1,5 @@
# Table of contents
- [Release Candidate 25 (TBD)](#release-candidate-25-tbd)
- [Release Candidate 25 (20 Jun 2021)](#release-candidate-25-20-jun-2021)
- [Release Candidate 24 (03 Jun 2021)](#release-candidate-24-03-jun-2021)
- [Release Candidate 23 (19 May 2021)](#release-candidate-23-19-may-2021)
- [Release Candidate 22 (18 Apr 2021)](#release-candidate-22-18-apr-2021)
@ -25,7 +25,7 @@
- [Release Candidate 2 (29 Sep 2019)](#release-candidate-2-29-sep-2019)
- [Release Candidate 1 (26 Sep 2019)](#release-candidate-1-26-sep-2019)
## Release Candidate 25 (TBD)
## Release Candidate 25 (20 Jun 2021)
#### Additions
* Added "4 Charcoal -> 1 Coal" recipe to the Compressor
@ -40,6 +40,7 @@
* Added "Raw Iron -> Iron Dust" recipe to the Ore Crusher
* Added "Raw Gold -> Gold Dust" recipe to the Ore Crusher
* Added "Raw Copper -> Copper Dust" recipe to the Ore Crusher
* Debug Fish can now read Slimefun Tags for vanilla blocks
#### Changes
* (API) Removed `SlimefunItem#getID()` (renamed to `SlimefunItem#getId()`)
@ -48,7 +49,7 @@
* (API) Removed AsyncReactorProcessCompleteEvent
#### Fixes
* Fixed 3105
* Fixed #3105
## Release Candidate 24 (03 Jun 2021)
https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#24

View File

@ -1,5 +1,7 @@
package io.github.thebusybiscuit.slimefun4.implementation.listeners;
import java.util.HashSet;
import java.util.Set;
import java.util.logging.Level;
import javax.annotation.Nonnull;
@ -27,6 +29,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunPlugin;
import io.github.thebusybiscuit.slimefun4.utils.HeadTexture;
import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils;
import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.api.BlockStorage;
@ -100,6 +104,26 @@ public class DebugFishListener implements Listener {
} catch (Exception x) {
SlimefunPlugin.logger().log(Level.SEVERE, "An Exception occurred while using a Debug-Fish", x);
}
} else {
// Read applicable Slimefun tags
Set<SlimefunTag> tags = new HashSet<>();
for (SlimefunTag tag : SlimefunTag.values()) {
if (tag.isTagged(b.getType())) {
tags.add(tag);
}
}
if (!tags.isEmpty()) {
p.sendMessage(" ");
p.sendMessage(ChatColors.color("&dSlimefun tags for: &e") + b.getType().name());
for (SlimefunTag tag : tags) {
p.sendMessage(ChatColors.color("&d* &e") + tag.name());
}
p.sendMessage(" ");
}
}
}