mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-16 18:55:02 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
0cc3fa06c2
commit
655636b7e9
231 files changed
+10024
-8585
No files matched your search
@@ -13,90 +13,111 @@ import minetweaker.api.server.ICommandFunction;
|
||||
import modtweaker2.helpers.LogHelper;
|
||||
import modtweaker2.helpers.StringHelper;
|
||||
import modtweaker2.mods.tconstruct.TConstructHelper;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import tconstruct.library.crafting.AlloyMix;
|
||||
import tconstruct.library.crafting.CastingRecipe;
|
||||
import tconstruct.library.crafting.DryingRackRecipes;
|
||||
import tconstruct.library.crafting.DryingRackRecipes.DryingRecipe;
|
||||
|
||||
public class TConstructLogger implements ICommandFunction {
|
||||
|
||||
private static final List<String> validArguments = new LinkedList<String>();
|
||||
|
||||
|
||||
static {
|
||||
validArguments.add("Casting");
|
||||
validArguments.add("Drying");
|
||||
validArguments.add("Smeltery");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void execute(String[] arguments, IPlayer player) {
|
||||
List<String> args = StringHelper.toLowerCase(Arrays.asList(arguments));
|
||||
|
||||
if(!validArguments.containsAll(args)) {
|
||||
if(player != null) {
|
||||
player.sendChat(MineTweakerImplementationAPI.platform.getMessage("Invalid arguments for command. Valid arguments: " + StringHelper.join(validArguments, ", ")));
|
||||
|
||||
if (!validArguments.containsAll(args)) {
|
||||
if (player != null) {
|
||||
player.sendChat(
|
||||
MineTweakerImplementationAPI.platform.getMessage(
|
||||
"Invalid arguments for command. Valid arguments: "
|
||||
+ StringHelper.join(validArguments, ", ")));
|
||||
}
|
||||
} else {
|
||||
if(args.isEmpty() || args.contains("Casting")) {
|
||||
for(CastingRecipe recipe : TConstructHelper.basinCasting) {
|
||||
MineTweakerAPI.logCommand(String.format("mods.tconstruct.Casting.addBasinRecipe(%s, %s, %s, %s, %d);",
|
||||
LogHelper.getStackDescription(recipe.output),
|
||||
LogHelper.getStackDescription(recipe.castingMetal),
|
||||
LogHelper.getStackDescription(recipe.cast),
|
||||
recipe.consumeCast,
|
||||
recipe.coolTime));
|
||||
if (args.isEmpty() || args.contains("Casting")) {
|
||||
for (CastingRecipe recipe : TConstructHelper.basinCasting) {
|
||||
MineTweakerAPI.logCommand(
|
||||
String.format(
|
||||
"mods.tconstruct.Casting.addBasinRecipe(%s, %s, %s, %s, %d);",
|
||||
LogHelper.getStackDescription(recipe.output),
|
||||
LogHelper.getStackDescription(recipe.castingMetal),
|
||||
LogHelper.getStackDescription(recipe.cast),
|
||||
recipe.consumeCast,
|
||||
recipe.coolTime));
|
||||
}
|
||||
|
||||
for(CastingRecipe recipe : TConstructHelper.tableCasting) {
|
||||
MineTweakerAPI.logCommand(String.format("mods.tconstruct.Casting.addTableRecipe(%s, %s, %s, %s, %d);",
|
||||
LogHelper.getStackDescription(recipe.output),
|
||||
LogHelper.getStackDescription(recipe.castingMetal),
|
||||
LogHelper.getStackDescription(recipe.cast),
|
||||
recipe.consumeCast,
|
||||
recipe.coolTime));
|
||||
|
||||
for (CastingRecipe recipe : TConstructHelper.tableCasting) {
|
||||
MineTweakerAPI.logCommand(
|
||||
String.format(
|
||||
"mods.tconstruct.Casting.addTableRecipe(%s, %s, %s, %s, %d);",
|
||||
LogHelper.getStackDescription(recipe.output),
|
||||
LogHelper.getStackDescription(recipe.castingMetal),
|
||||
LogHelper.getStackDescription(recipe.cast),
|
||||
recipe.consumeCast,
|
||||
recipe.coolTime));
|
||||
}
|
||||
}
|
||||
|
||||
if(args.isEmpty() || args.contains("Drying")) {
|
||||
for(DryingRecipe recipe : DryingRackRecipes.recipes) {
|
||||
MineTweakerAPI.logCommand(String.format("mods.tconstruct.Drying.addRecipe(%s, %s, %d);",
|
||||
LogHelper.getStackDescription(recipe.input),
|
||||
LogHelper.getStackDescription(recipe.result),
|
||||
recipe.time));
|
||||
|
||||
if (args.isEmpty() || args.contains("Drying")) {
|
||||
for (DryingRecipe recipe : DryingRackRecipes.recipes) {
|
||||
MineTweakerAPI.logCommand(
|
||||
String.format(
|
||||
"mods.tconstruct.Drying.addRecipe(%s, %s, %d);",
|
||||
LogHelper.getStackDescription(recipe.input),
|
||||
LogHelper.getStackDescription(recipe.result),
|
||||
recipe.time));
|
||||
}
|
||||
}
|
||||
|
||||
if(args.isEmpty() || args.contains("Smeltery")) {
|
||||
|
||||
for(Entry<ItemMetaWrapper, FluidStack> recipe : TConstructHelper.smeltingList.entrySet()) {
|
||||
|
||||
if (args.isEmpty() || args.contains("Smeltery")) {
|
||||
|
||||
for (Entry<ItemMetaWrapper, FluidStack> recipe : TConstructHelper.smeltingList.entrySet()) {
|
||||
int temperature = TConstructHelper.temperatureList.get(recipe.getKey());
|
||||
ItemStack renderItem = TConstructHelper.renderIndex.get(recipe.getKey());
|
||||
|
||||
MineTweakerAPI.logCommand(String.format("mods.tconstruct.Smeltery.addMelting(%s, %s, %d, %s);",
|
||||
LogHelper.getStackDescription(new ItemStack(recipe.getKey().item, 1, recipe.getKey().meta)),
|
||||
LogHelper.getStackDescription(recipe.getValue()),
|
||||
temperature,
|
||||
LogHelper.getStackDescription(renderItem)));
|
||||
|
||||
MineTweakerAPI.logCommand(
|
||||
String.format(
|
||||
"mods.tconstruct.Smeltery.addMelting(%s, %s, %d, %s);",
|
||||
LogHelper.getStackDescription(
|
||||
new ItemStack(recipe.getKey().item, 1, recipe.getKey().meta)),
|
||||
LogHelper.getStackDescription(recipe.getValue()),
|
||||
temperature,
|
||||
LogHelper.getStackDescription(renderItem)));
|
||||
}
|
||||
|
||||
for(AlloyMix recipe : TConstructHelper.alloys) {
|
||||
MineTweakerAPI.logCommand(String.format("mods.tconstruct.Smeltery.addAlloy(%s, %s);",
|
||||
LogHelper.getStackDescription(recipe.result),
|
||||
LogHelper.getListDescription(recipe.mixers)));
|
||||
|
||||
for (AlloyMix recipe : TConstructHelper.alloys) {
|
||||
MineTweakerAPI.logCommand(
|
||||
String.format(
|
||||
"mods.tconstruct.Smeltery.addAlloy(%s, %s);",
|
||||
LogHelper.getStackDescription(recipe.result),
|
||||
LogHelper.getListDescription(recipe.mixers)));
|
||||
}
|
||||
|
||||
for(Entry<Fluid, Integer[]> fuel : TConstructHelper.fuelList.entrySet()) {
|
||||
MineTweakerAPI.logCommand(String.format("mods.tconstruct.Smeltery.addFuel(%s, %d, %d);",
|
||||
LogHelper.getStackDescription(new FluidStack(fuel.getKey(), 1)),
|
||||
fuel.getValue()[0],
|
||||
fuel.getValue()[1]));
|
||||
|
||||
for (Entry<Fluid, Integer[]> fuel : TConstructHelper.fuelList.entrySet()) {
|
||||
MineTweakerAPI.logCommand(
|
||||
String.format(
|
||||
"mods.tconstruct.Smeltery.addFuel(%s, %d, %d);",
|
||||
LogHelper.getStackDescription(new FluidStack(fuel.getKey(), 1)),
|
||||
fuel.getValue()[0],
|
||||
fuel.getValue()[1]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (player != null) {
|
||||
player.sendChat(MineTweakerImplementationAPI.platform.getMessage("List generated; see minetweaker.log in your minecraft dir"));
|
||||
player.sendChat(
|
||||
MineTweakerImplementationAPI.platform
|
||||
.getMessage("List generated; see minetweaker.log in your minecraft dir"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user