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