mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Some cleanup
This commit is contained in:
parent
6da4cc6536
commit
595767ad03
@ -37,6 +37,7 @@
|
||||
* Fixed Nuclear Reactors accepting Lava as coolant
|
||||
|
||||
## Release Candidate 12 (27 May 2020)
|
||||
https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#12
|
||||
|
||||
#### Additions
|
||||
* Added Ukrainian translations
|
||||
@ -81,6 +82,7 @@
|
||||
* Fixed #1935
|
||||
|
||||
## Release Candidate 11 (25 Apr 2020)
|
||||
https://thebusybiscuit.github.io/builds/TheBusyBiscuit/Slimefun4/stable/#11
|
||||
|
||||
#### Additions
|
||||
* Added GEOResourceGenerationEvent
|
||||
|
@ -10,6 +10,7 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
|
||||
import io.github.thebusybiscuit.cscorelib2.players.PlayerList;
|
||||
import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand;
|
||||
import io.github.thebusybiscuit.slimefun4.core.commands.SubCommand;
|
||||
import io.github.thebusybiscuit.slimefun4.utils.PatternUtils;
|
||||
import me.mrCookieSlime.Slimefun.SlimefunPlugin;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.multiblocks.MultiBlockMachine;
|
||||
@ -44,6 +45,7 @@ class GiveCommand extends SubCommand {
|
||||
Player p = player.get();
|
||||
|
||||
SlimefunItem sfItem = SlimefunItem.getByID(args[2].toUpperCase(Locale.ROOT));
|
||||
|
||||
if (sfItem != null) {
|
||||
if (sfItem instanceof MultiBlockMachine) {
|
||||
SlimefunPlugin.getLocal().sendMessage(sender, "guide.cheat.no-multiblocks");
|
||||
@ -74,7 +76,7 @@ class GiveCommand extends SubCommand {
|
||||
int amount = 1;
|
||||
|
||||
if (args.length == 4) {
|
||||
if (args[3].chars().allMatch(Character::isDigit)) {
|
||||
if (PatternUtils.NUMERIC.matcher(args[3]).matches()) {
|
||||
amount = Integer.parseInt(args[3]);
|
||||
}
|
||||
else {
|
||||
|
@ -8,7 +8,6 @@ import org.bukkit.entity.Player;
|
||||
import io.github.thebusybiscuit.slimefun4.api.exceptions.IncompatibleItemHandlerException;
|
||||
import io.github.thebusybiscuit.slimefun4.core.MultiBlock;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunMachine;
|
||||
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.multiblocks.MultiBlockMachine;
|
||||
|
||||
/**
|
||||
@ -31,8 +30,7 @@ public interface MultiBlockInteractionHandler extends ItemHandler {
|
||||
|
||||
@Override
|
||||
default Optional<IncompatibleItemHandlerException> validate(SlimefunItem item) {
|
||||
// Change this to "MultiBlockMachine" once SlimefunMachine was removed or deprecated
|
||||
if (!(item instanceof SlimefunMachine)) {
|
||||
if (!(item instanceof MultiBlockMachine)) {
|
||||
return Optional.of(new IncompatibleItemHandlerException("Only classes inheriting 'MultiBlockMachine' can have a MultiBlockInteractionHandler", item, this));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user