aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kubatech/commands
diff options
context:
space:
mode:
authorJason Mitchell <mitchej@gmail.com>2023-01-28 19:03:53 -0800
committerJason Mitchell <mitchej@gmail.com>2023-01-28 19:03:53 -0800
commitf51616bda220887fdd45c4bc951ff59e3398213a (patch)
tree35fdbb15b4c7ea0282773a388eff517a1d09d941 /src/main/java/kubatech/commands
parent11216d666cbc30fc1e1dfc84e1e0c2f4252b1fc2 (diff)
downloadGT5-Unofficial-f51616bda220887fdd45c4bc951ff59e3398213a.tar.gz
GT5-Unofficial-f51616bda220887fdd45c4bc951ff59e3398213a.tar.bz2
GT5-Unofficial-f51616bda220887fdd45c4bc951ff59e3398213a.zip
[ci skip] spotlessApply with the new settings
Diffstat (limited to 'src/main/java/kubatech/commands')
-rw-r--r--src/main/java/kubatech/commands/CommandBees.java40
-rw-r--r--src/main/java/kubatech/commands/CommandConfig.java30
-rw-r--r--src/main/java/kubatech/commands/CommandHandler.java41
-rw-r--r--src/main/java/kubatech/commands/CommandHelp.java35
-rw-r--r--src/main/java/kubatech/commands/CommandTea.java30
5 files changed, 71 insertions, 105 deletions
diff --git a/src/main/java/kubatech/commands/CommandBees.java b/src/main/java/kubatech/commands/CommandBees.java
index 62f81fe7cf..2d6e746812 100644
--- a/src/main/java/kubatech/commands/CommandBees.java
+++ b/src/main/java/kubatech/commands/CommandBees.java
@@ -1,40 +1,35 @@
/*
- * KubaTech - Gregtech Addon
- * Copyright (C) 2022 - 2023 kuba6000
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library. If not, see <https://www.gnu.org/licenses/>.
- *
+ * KubaTech - Gregtech Addon Copyright (C) 2022 - 2023 kuba6000 This library is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in
+ * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have
+ * received a copy of the GNU Lesser General Public License along with this library. If not, see
+ * <https://www.gnu.org/licenses/>.
*/
package kubatech.commands;
import static forestry.api.apiculture.BeeManager.beeRoot;
-import com.google.common.io.Files;
-import forestry.api.apiculture.IAlleleBeeSpecies;
-import forestry.api.apiculture.IBee;
-import forestry.api.apiculture.IBeeGenome;
import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List;
+
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.item.ItemStack;
+import com.google.common.io.Files;
+
+import forestry.api.apiculture.IAlleleBeeSpecies;
+import forestry.api.apiculture.IBee;
+import forestry.api.apiculture.IBeeGenome;
+
public class CommandBees extends CommandBase {
+
@Override
public String getCommandName() {
return "bees";
@@ -116,9 +111,8 @@ public class CommandBees extends CommandBase {
chance *= 100f;
float productionModifier = (float) upgradeCount * 0.25f;
return (float) (((1f + t / 6f) * Math.sqrt(chance) * 2f * (1f + beeSpeed)
- + Math.pow(productionModifier, Math.cbrt(chance))
- - 3f)
- / 100f);
+ + Math.pow(productionModifier, Math.cbrt(chance))
+ - 3f) / 100f);
}
private double productChanceOld(int upgradeCount, double beeSpeed, double chance) {
diff --git a/src/main/java/kubatech/commands/CommandConfig.java b/src/main/java/kubatech/commands/CommandConfig.java
index 70c7f1d6e5..b2d9fb09e7 100644
--- a/src/main/java/kubatech/commands/CommandConfig.java
+++ b/src/main/java/kubatech/commands/CommandConfig.java
@@ -1,20 +1,11 @@
/*
- * KubaTech - Gregtech Addon
- * Copyright (C) 2022 - 2023 kuba6000
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library. If not, see <https://www.gnu.org/licenses/>.
- *
+ * KubaTech - Gregtech Addon Copyright (C) 2022 - 2023 kuba6000 This library is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in
+ * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have
+ * received a copy of the GNU Lesser General Public License along with this library. If not, see
+ * <https://www.gnu.org/licenses/>.
*/
package kubatech.commands;
@@ -25,6 +16,7 @@ import kubatech.api.network.LoadConfigPacket;
import kubatech.config.Config;
import kubatech.kubatech;
import kubatech.loaders.MobRecipeLoader;
+
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
@@ -33,11 +25,13 @@ import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector;
public class CommandConfig extends CommandBase {
+
enum Translations {
+
INVALID_OPTION,
SUCCESS,
- USAGE,
- ;
+ USAGE,;
+
final String key;
Translations() {
diff --git a/src/main/java/kubatech/commands/CommandHandler.java b/src/main/java/kubatech/commands/CommandHandler.java
index 65be53b715..4694b9ca2f 100644
--- a/src/main/java/kubatech/commands/CommandHandler.java
+++ b/src/main/java/kubatech/commands/CommandHandler.java
@@ -1,20 +1,11 @@
/*
- * KubaTech - Gregtech Addon
- * Copyright (C) 2022 - 2023 kuba6000
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library. If not, see <https://www.gnu.org/licenses/>.
- *
+ * KubaTech - Gregtech Addon Copyright (C) 2022 - 2023 kuba6000 This library is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in
+ * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have
+ * received a copy of the GNU Lesser General Public License along with this library. If not, see
+ * <https://www.gnu.org/licenses/>.
*/
package kubatech.commands;
@@ -22,6 +13,7 @@ package kubatech.commands;
import static kubatech.commands.CommandHandler.Translations.*;
import java.util.*;
+
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
@@ -31,12 +23,14 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
public class CommandHandler extends CommandBase {
+
enum Translations {
+
INVALID,
CANT_FIND,
GENERIC_HELP,
- USAGE,
- ;
+ USAGE,;
+
final String key;
Translations() {
@@ -95,14 +89,13 @@ public class CommandHandler extends CommandBase {
}
ICommand cmd = commands.get(p_71515_2_[0]);
if (!cmd.canCommandSenderUseCommand(p_71515_1_)) {
- ChatComponentTranslation chatcomponenttranslation2 =
- new ChatComponentTranslation("commands.generic.permission");
+ ChatComponentTranslation chatcomponenttranslation2 = new ChatComponentTranslation(
+ "commands.generic.permission");
chatcomponenttranslation2.getChatStyle().setColor(EnumChatFormatting.RED);
p_71515_1_.addChatMessage(chatcomponenttranslation2);
- } else
- cmd.processCommand(
- p_71515_1_,
- p_71515_2_.length > 1 ? Arrays.copyOfRange(p_71515_2_, 1, p_71515_2_.length) : new String[0]);
+ } else cmd.processCommand(
+ p_71515_1_,
+ p_71515_2_.length > 1 ? Arrays.copyOfRange(p_71515_2_, 1, p_71515_2_.length) : new String[0]);
}
@Override
diff --git a/src/main/java/kubatech/commands/CommandHelp.java b/src/main/java/kubatech/commands/CommandHelp.java
index 8c7d70df81..822c56dd5a 100644
--- a/src/main/java/kubatech/commands/CommandHelp.java
+++ b/src/main/java/kubatech/commands/CommandHelp.java
@@ -1,20 +1,11 @@
/*
- * KubaTech - Gregtech Addon
- * Copyright (C) 2022 - 2023 kuba6000
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library. If not, see <https://www.gnu.org/licenses/>.
- *
+ * KubaTech - Gregtech Addon Copyright (C) 2022 - 2023 kuba6000 This library is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in
+ * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have
+ * received a copy of the GNU Lesser General Public License along with this library. If not, see
+ * <https://www.gnu.org/licenses/>.
*/
package kubatech.commands;
@@ -28,10 +19,12 @@ import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector;
public class CommandHelp extends CommandBase {
+
enum Translations {
+
POSSIBLE_COMMANDS,
- USAGE,
- ;
+ USAGE,;
+
final String key;
Translations() {
@@ -74,9 +67,7 @@ public class CommandHelp extends CommandBase {
@Override
public void processCommand(ICommandSender p_71515_1_, String[] p_71515_2_) {
p_71515_1_.addChatMessage(new ChatComponentText(POSSIBLE_COMMANDS.get()));
- CommandHandler.commands
- .values()
- .forEach(c ->
- p_71515_1_.addChatMessage(new ChatComponentText("/kubatech " + c.getCommandUsage(p_71515_1_))));
+ CommandHandler.commands.values().forEach(
+ c -> p_71515_1_.addChatMessage(new ChatComponentText("/kubatech " + c.getCommandUsage(p_71515_1_))));
}
}
diff --git a/src/main/java/kubatech/commands/CommandTea.java b/src/main/java/kubatech/commands/CommandTea.java
index 7a34d452ce..726b8ce799 100644
--- a/src/main/java/kubatech/commands/CommandTea.java
+++ b/src/main/java/kubatech/commands/CommandTea.java
@@ -1,20 +1,11 @@
/*
- * KubaTech - Gregtech Addon
- * Copyright (C) 2022 - 2023 kuba6000
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library. If not, see <https://www.gnu.org/licenses/>.
- *
+ * KubaTech - Gregtech Addon Copyright (C) 2022 - 2023 kuba6000 This library is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in
+ * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have
+ * received a copy of the GNU Lesser General Public License along with this library. If not, see
+ * <https://www.gnu.org/licenses/>.
*/
package kubatech.commands;
@@ -23,20 +14,23 @@ import static kubatech.commands.CommandTea.Translations.*;
import kubatech.savedata.PlayerData;
import kubatech.savedata.PlayerDataManager;
+
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector;
public class CommandTea extends CommandBase {
+
enum Translations {
+
INVALID_OPTION,
PLAYER_NOT_FOUND,
SUCCESS_GET,
SUCCESS_SET,
SUCCESS_ADD,
- USAGE,
- ;
+ USAGE,;
+
final String key;
Translations() {