DoctorC
Members-
Posts
39 -
Joined
-
Last visited
Everything posted by DoctorC
-
Okay, thanks! I've been trying out Mixins, but can't figure out how Surface Rules work, so I'll probably just wait.
-
Hello! I have implemented a custom biome, but am not sure how to change the surface of it. In the past, I used a surfacebuilder to have red sand as my top layer, but I'm not sure how to do this in 1.18. Currently, I am looking at Mixins in SurfaceRuleData (I think this is how Fabric does it). Unfortunately, this doesn't work well with Forge Registry items. How should I go about changing the surface of my biome?
-
Hmm, okay. Yeah I need to do recipes, but I'll probably just have to hard code in this specific case and have recipes as overrides. Thanks!
-
Yes, I've used the method before. Are you suggesting that I loop through every single registered block and see if it is burnable? That seems pretty laggy and I'm not even sure how to get a list of all blocks. I could yeah, but I'm not sure what you'd need to see.
-
So I would like to create a custom recipe where one of the items can be any furnace fuel. I tried using AbstractFurnaceTileEntity.getFuel() and creating an Ingredient from its keys. Unfortunately, there are a few issues with this: this method is deprecated it came up with this error on runData: "Tag minecraft:non_flammable_wood used before it was bound" it doesn't support custom furnace fuels added by other mods (I think) What would the correct way to generate a list of all furnace fuels be?
-
It works! I'm not sure about your final point about Ingredient.fromJson working already, as I used a different JSON key ('ingredientWithout' instead of 'ingredient') - so I didn't change this. Sorry to bother you again but what did you mean by 'forge:compound' earlier as a method of removing both bricks and nether bricks. I can easily do this with a custom tag, just wondering if that would be an easier way? Thanks!
-
Yep, thanks - I've fixed this. Now that I have fixed up the getItems() method, JEI has all the ingots except brick - so that respect is working great! I've done this - but unfortunately the recipe still works with brick. Here are my new files: IngredientWithout.java: package my.mod.crafting; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.Ingredient; import net.minecraft.tags.ITag; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.Arrays; import java.util.stream.Collectors; import java.util.stream.Stream; public class IngredientWithout extends Ingredient { private final Ingredient of; private final Ingredient without; protected IngredientWithout(@Nonnull ITag<Item> of, ITag<Item> without) { super(Stream.of(new Ingredient.TagList(of))); this.of = Ingredient.of(of); this.without = Ingredient.of(without); } protected IngredientWithout(@Nonnull Ingredient of, Ingredient without) { super(Arrays.stream(of.getItems()).filter((item) -> !item.isEmpty()).map(SingleItemList::new)); this.of = of; this.without = without; } public static IngredientWithout of(ITag<Item> of, ITag<Item> without) { return new IngredientWithout(of, without); } public static IngredientWithout fromJson(JsonElement jsonElement) { return new IngredientWithout(Ingredient.fromJson(jsonElement.getAsJsonObject().get("of")), Ingredient.fromJson(jsonElement.getAsJsonObject().get("without"))); } @Override public ItemStack[] getItems() { return Arrays.stream(this.of.getItems()).filter( ofItemStack -> !Arrays.stream(this.without.getItems()) .map(ItemStack::getItem) .collect(Collectors.toList()).contains(ofItemStack.getItem())) .toArray(ItemStack[]::new); } @Override public boolean test(@Nullable ItemStack p_test_1_) { if (super.test(p_test_1_)) { for (ItemStack itemStack : this.of.getItems()) { if (!this.without.test(itemStack)) return true; } } return false; } @Override public JsonElement toJson() { JsonObject jsonObject = new JsonObject(); jsonObject.add("of", this.of.toJson()); jsonObject.add("without", this.without.toJson()); return jsonObject; } } PressingRecipe.java: package my.mod.crafting.recipe; import com.google.gson.JsonObject; import my.mod.crafting.IngredientWithout; import my.mod.setup.ModRecipes; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipeSerializer; import net.minecraft.item.crafting.Ingredient; import net.minecraft.item.crafting.SingleItemRecipe; import net.minecraft.network.PacketBuffer; import net.minecraft.util.JSONUtils; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.ForgeRegistryEntry; import javax.annotation.Nullable; public class PressingRecipe extends SingleItemRecipe { public PressingRecipe(ResourceLocation recipeId, Ingredient ingredient, ItemStack result) { super(ModRecipes.Types.PRESSING, ModRecipes.Serialisers.PRESSING.get(), recipeId, "", ingredient, result); } @Override public boolean matches(IInventory inv, World world) { return this.ingredient.test(inv.getItem(0)); } public static class Serialiser extends ForgeRegistryEntry<IRecipeSerializer<?>> implements IRecipeSerializer<PressingRecipe> { @Override public PressingRecipe fromJson(ResourceLocation recipeId, JsonObject json) { ResourceLocation itemId = new ResourceLocation(JSONUtils.getAsString(json, "result")); int count = JSONUtils.getAsInt(json, "count", 1); ItemStack result = new ItemStack(ForgeRegistries.ITEMS.getValue(itemId), count); if (json.has("ingredientWithout")) { IngredientWithout ingredient = IngredientWithout.fromJson(json.get("ingredientWithout")); return new PressingRecipe(recipeId, ingredient, result); } else { Ingredient ingredient = Ingredient.fromJson(json.get("ingredient")); return new PressingRecipe(recipeId, ingredient, result); } } @Nullable @Override public PressingRecipe fromNetwork(ResourceLocation recipeId, PacketBuffer buffer) { Ingredient ingredient = Ingredient.fromNetwork(buffer); ItemStack result = buffer.readItem(); return new PressingRecipe(recipeId, ingredient, result); } @Override public void toNetwork(PacketBuffer buffer, PressingRecipe recipe) { recipe.ingredient.toNetwork(buffer); buffer.writeItem(recipe.result); } } }
-
Okay, so I've tried to implement this: IngredientWithout.java package my.mod.crafting; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.Ingredient; import net.minecraft.tags.ITag; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.Arrays; import java.util.stream.Collectors; import java.util.stream.Stream; public class IngredientWithout extends Ingredient { private final Ingredient of; private final Ingredient without; protected IngredientWithout(@Nonnull ITag<Item> of, ITag<Item> without) { super(Stream.of(new Ingredient.TagList(of))); this.of = Ingredient.of(of); this.without = Ingredient.of(without); } protected IngredientWithout(@Nonnull Ingredient of, Ingredient without) { super(Arrays.stream(of.getItems()).filter((item) -> !item.isEmpty()).map(SingleItemList::new)); this.of = of; this.without = without; } public static IngredientWithout of(ITag<Item> of, ITag<Item> without) { return new IngredientWithout(of, without); } public static IngredientWithout of(Ingredient of, Ingredient without) { return new IngredientWithout(of, without); } public static IngredientWithout fromJson(JsonElement jsonElement) { return new IngredientWithout(Ingredient.fromJson(jsonElement.getAsJsonObject().get("of")), Ingredient.fromJson(jsonElement.getAsJsonObject().get("without"))); } public Ingredient of() { return this.of; } public Ingredient without() { return this.without; } @Override public ItemStack[] getItems() { return Arrays.stream(this.of.getItems()).filter( item -> Arrays.asList(this.without.getItems()).contains(item)) .toArray(ItemStack[]::new); } @Override public boolean test(@Nullable ItemStack p_test_1_) { if (super.test(p_test_1_)) { for (ItemStack itemStack : this.of.getItems()) { if (!this.without.test(itemStack)) return true; } } return false; } @Override public JsonElement toJson() { JsonObject jsonObject = new JsonObject(); jsonObject.add("of", this.of.toJson()); jsonObject.add("without", this.without.toJson()); return jsonObject; } } I already have a Serialiser (as the recipe is for a custom Tile Entity), and have successfully implemented fromJson, but I'm not sure how to do fromNetwork and toNetwork as there are two ingredients: PressingRecipe.java package my.mod.crafting.recipe; import com.google.gson.JsonObject; import my.mod.crafting.IngredientWithout; import my.mod.setup.ModRecipes; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipeSerializer; import net.minecraft.item.crafting.Ingredient; import net.minecraft.item.crafting.SingleItemRecipe; import net.minecraft.network.PacketBuffer; import net.minecraft.util.JSONUtils; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.ForgeRegistryEntry; import javax.annotation.Nullable; public class PressingRecipe extends SingleItemRecipe { public PressingRecipe(ResourceLocation recipeId, Ingredient ingredient, ItemStack result) { super(ModRecipes.Types.PRESSING, ModRecipes.Serialisers.PRESSING.get(), recipeId, "", ingredient, result); } @Override public boolean matches(IInventory inv, World world) { return this.ingredient.test(inv.getItem(0)); } public static class Serialiser extends ForgeRegistryEntry<IRecipeSerializer<?>> implements IRecipeSerializer<PressingRecipe> { @Override public PressingRecipe fromJson(ResourceLocation recipeId, JsonObject json) { ResourceLocation itemId = new ResourceLocation(JSONUtils.getAsString(json, "result")); int count = JSONUtils.getAsInt(json, "count", 1); ItemStack result = new ItemStack(ForgeRegistries.ITEMS.getValue(itemId), count); if (json.has("ingredientWithout")) { IngredientWithout ingredient = IngredientWithout.fromJson(json.get("ingredientWithout")); return new PressingRecipe(recipeId, ingredient, result); } else { Ingredient ingredient = Ingredient.fromJson(json.get("ingredient")); return new PressingRecipe(recipeId, ingredient, result); } } @Nullable @Override public PressingRecipe fromNetwork(ResourceLocation recipeId, PacketBuffer buffer) { Ingredient of = Ingredient.fromNetwork(buffer); Ingredient without = Ingredient.fromNetwork(buffer); ItemStack result = buffer.readItem(); return new PressingRecipe(recipeId, IngredientWithout.of(of, without), result); } @Override public void toNetwork(PacketBuffer buffer, PressingRecipe recipe) { if (recipe.ingredient instanceof IngredientWithout) { ((IngredientWithout) recipe.ingredient).of().toNetwork(buffer); ((IngredientWithout) recipe.ingredient).without().toNetwork(buffer); } else { recipe.ingredient.toNetwork(buffer); } buffer.writeItem(recipe.result); } } } And this is how I implemented the recipe: PressingRecipeBuilder.builder(IngredientWithout.of(Tags.Items.INGOTS, Tags.Items.INGOTS_BRICK), ModItems.SHEET_METAL.get()) .unlockedBy("has_item", has(Tags.Items.INGOTS)) .save(consumer, mod("sheet_metal_pressing")); Unfortunately, anything from the forge:ingots tag seems to still work. This has also messed up my JEI integration (the input is blank in the JEI screen).
-
Okay, I implemented this (without the forge:compound, no idea how to do this): package my.mod.crafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.Ingredient; import java.util.Arrays; import java.util.stream.Stream; public class IngredientWithout extends Ingredient { protected IngredientWithout(Stream<? extends IItemList> p_i49381_1_) { super(p_i49381_1_); } public static IngredientWithout of(Ingredient of, Ingredient without) { Stream<ItemStack> withoutItems = Arrays.stream(of.getItems()).filter(without); IngredientWithout ing = new IngredientWithout(withoutItems.filter((item) -> !item.isEmpty()).map(SingleItemList::new)); return ing.getItems().length == 0 ? new IngredientWithout(Stream.empty()) : ing; } } But it produced the same issue:
-
Sorry, I'm still not sure what you mean? I have a RegistryObject<IRecipeSerializer<PressingRecipe>> which is used for my custom recipe type. I have tried creating an Ingredient from a list of ItemStacks, generated using Tags.Items.INGOTS and removing the brick and nether brick tags (similar to as seen above) - but this produced the same error as in my original post.
-
It uses a custom recipe builder, but it's pretty similar to the furnace builders: PressingRecipeBuilder.builder(Ingredient.of(ModTags.Items.INGOTS_METAL), ModItems.SHEET_METAL.get()) .unlockedBy("has_item", has(ModTags.Items.INGOTS_METAL)) .save(consumer, mod("sheet_metal_pressing"))
-
Sorry. You said that 'I would just check at runtime if the item is in the ingots tag but not in the brick or nether brick tags'. How would I go about doing this?
-
Okay, I guess that's the only option. I'd like to have multiple recipes, so is there a good way to remove the bricks for the specific recipe instead of completely removing any support for them as an input Ingredient?
-
I think this is what you mean? ModItemTagsProvider.java package my.mod.data; import my.mod.Main; import my.mod.setup.ModTags; import net.minecraft.data.BlockTagsProvider; import net.minecraft.data.DataGenerator; import net.minecraft.data.ItemTagsProvider; import net.minecraft.item.Item; import net.minecraftforge.common.Tags; import net.minecraftforge.common.data.ExistingFileHelper; import java.util.List; public class ModItemTagsProvider extends ItemTagsProvider { public ModItemTagsProvider(DataGenerator dataGenerator, BlockTagsProvider blockTagsProvider, ExistingFileHelper existingFileHelper) { super(dataGenerator, blockTagsProvider, Main.MOD_ID, existingFileHelper); } @Override protected void addTags() { List<Item> metalIngots = Tags.Items.INGOTS.getValues(); metalIngots.removeAll(Tags.Items.INGOTS_BRICK.getValues()); metalIngots.removeAll(Tags.Items.INGOTS_NETHER_BRICK.getValues()); tag(ModTags.Items.INGOTS_METAL).add(metalIngots.toArray(new Item[0])); } } DataGenerators.java package my.mod.data; import my.mod.Main; import my.mod.data.ModBlockTagsProvider; import my.mod.data.ModItemTagsProvider; import net.minecraft.data.DataGenerator; import net.minecraftforge.common.data.ExistingFileHelper; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.event.lifecycle.GatherDataEvent; @EventBusSubscriber(modid = Main.MOD_ID, bus = EventBusSubscriber.Bus.MOD) public class DataGenerators { @SubscribeEvent public static void gatherData(GatherDataEvent event) { DataGenerator gen = event.getGenerator(); ExistingFileHelper fileHelper = event.getExistingFileHelper(); ModBlockTagsProvider blockTags = new ModBlockTagsProvider(gen, fileHelper); gen.addProvider(blockTags); gen.addProvider(new ModItemTagsProvider(gen, blockTags, fileHelper)); } } ModTags.java package my.mod.setup; import my.mod.Main; import net.minecraft.tags.ITag; import net.minecraft.util.ResourceLocation; import net.minecraft.item.Item; public class ModTags { public static final class Items { public static final ITag.INamedTag<Item> INGOTS_METAL = mod("metal_ingots"); private static ITag.INamedTag<Item> mod(String path) { return ItemTags.createOptional(new ResourceLocation(Main.MOD_ID, path)); } } }
-
Sorry, that's what I was doing? If you mean create my own complete tag, I tried mod:metal_ingots, but this raised the exact same error. Or, if you mean just putting iron, gold, and netherite in the same tag - other mods won't automatically integrate if they add their ingots to the forge:ingots tag.
-
I have been trying to use the forge:ingots tag (as an Ingredient) in a custom recipe to create a 'sheet metal' item. Unfortunately, I found that this tag includes brick and nether brick as well as the metal ingots. I could just use the individual forge:ingots/gold, forge:ingots/iron, etc. tags - but this means that new ingots added to the forge:ingots tag won't automatically work with my recipe. As a workaround, I tried to create a forge:ingots/metals tag, using the following code: List<Item> metalIngots = Tags.Items.INGOTS.getValues(); metalIngots.removeAll(Tags.Items.INGOTS_BRICK.getValues()); metalIngots.removeAll(Tags.Items.INGOTS_NETHER_BRICK.getValues()); tag(ModTags.Items.INGOTS_METAL).add(metalIngots.toArray(new Item[0])); Where ModTags.Items.INGOTS_METAL is the tag I created. Unfortunately, it comes up with this error on runData: java.lang.IllegalStateException: Tag forge:ingots used before it was bound The error seems to arise from the first line (Tags.Items.INGOTS.getValues()) Here is the stack trace: I also tried a similar approach directly in my RecipeProvider class to generate an Ingredient there - but the same issue arose. Is there any way of creating an in Ingredient that includes all metal (non-brick) ingots?
-
Of course, thanks!
-
I'm trying to do some data generating (recipes specifically), but the GatherDataEvent event isn't firing. This is my current code: @Mod.EventBusSubscriber(modid = Main.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) public class ModNameDataGenerator { private ModNameDataGenerator() {} @SubscribeEvent public static void gatherData(GatherDataEvent event) { Main.LOGGER.log(Level.INFO, "Enter Data gen"); DataGenerator gen = event.getGenerator(); if (event.includeServer()) { Main.LOGGER.log(Level.INFO, "Enter Data gen server"); gen.addProvider(new RecipeDataGen(gen)); } } } The logging is to make sure the RecipeDataGen isn't the problem. (btw Main.LOGGER is this:) public static final Logger LOGGER = LogManager.getLogger("Mod Name");
-
Ah, so replacing anything inside the mods.toml would not be useful at all?
-
Because it's easier to define everything in gradle.properties, and not have to think about the other files.
-
I read something somewhere that suggested using processResources to replace things in mods.toml. Having little experience with ForgeGradle, I'm not sure what the problem is. This is my current processResources (build.gradle): // Process Resources on build processResources { inputs.property 'mod_version', version inputs.property 'mod_id', archivesBaseName from (sourceSets.main.resources.srcDirs) { include 'META-INF/mods.toml' expand 'mod_version': version expand 'mod_id': archivesBaseName expand 'mod_name': "${mod_name}" expand 'mod_description': "${mod_description}" expand 'loader_version': "${loader_version}" } from (sourceSets.main.resources.srcDirs) { exclude 'META-INF/mods.toml' } } I've defined ${mod_name}, ${mod_description}, etc. etc. already, using gradle.properties. I am getting this error on running processResources. I've also tried runClient but the same thing happens: Execution failed for task ':processResources'. > Could not copy file 'Mod Folder\src\main\resources\META-INF\mods.toml' to 'Mod Folder\build\resources\main\META-INF\mods.toml'. * Try: Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':processResources'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77) at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59) at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101) at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46) at org.gradle.execution.taskgraph.LocalTaskInfoExecutor.execute(LocalTaskInfoExecutor.java:42) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:277) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:262) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:135) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(DefaultTaskPlanExecutor.java:200) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(DefaultTaskPlanExecutor.java:191) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutor.java:130) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) Caused by: org.gradle.api.GradleException: Could not copy file 'Mod Folder\src\main\resources\META-INF\mods.toml' to 'Mod Folder\build\resources\main\META-INF\mods.toml'. at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:79) at org.gradle.api.internal.file.copy.DefaultFileCopyDetails.copyTo(DefaultFileCopyDetails.java:109) at org.gradle.api.internal.file.copy.FileCopyAction$FileCopyDetailsInternalAction.processFile(FileCopyAction.java:44) at org.gradle.api.internal.file.copy.NormalizingCopyActionDecorator$1$1.processFile(NormalizingCopyActionDecorator.java:66) at org.gradle.api.internal.file.copy.DuplicateHandlingCopyActionDecorator$1$1.processFile(DuplicateHandlingCopyActionDecorator.java:60) at org.gradle.api.internal.file.copy.CopyFileVisitorImpl.processFile(CopyFileVisitorImpl.java:62) at org.gradle.api.internal.file.copy.CopyFileVisitorImpl.visitFile(CopyFileVisitorImpl.java:46) at org.gradle.api.internal.file.collections.jdk7.Jdk7DirectoryWalker$1.visitFile(Jdk7DirectoryWalker.java:86) at org.gradle.api.internal.file.collections.jdk7.Jdk7DirectoryWalker$1.visitFile(Jdk7DirectoryWalker.java:59) at org.gradle.api.internal.file.collections.jdk7.Jdk7DirectoryWalker.walkDir(Jdk7DirectoryWalker.java:59) at org.gradle.api.internal.file.collections.DirectoryFileTree.walkDir(DirectoryFileTree.java:154) at org.gradle.api.internal.file.collections.DirectoryFileTree.visitFrom(DirectoryFileTree.java:132) at org.gradle.api.internal.file.collections.DirectoryFileTree.visit(DirectoryFileTree.java:117) at org.gradle.api.internal.file.collections.FileTreeAdapter.visit(FileTreeAdapter.java:117) at org.gradle.api.internal.file.CompositeFileTree.visit(CompositeFileTree.java:93) at org.gradle.api.internal.file.copy.CopySpecActionImpl.execute(CopySpecActionImpl.java:39) at org.gradle.api.internal.file.copy.CopySpecActionImpl.execute(CopySpecActionImpl.java:24) at org.gradle.api.internal.file.copy.DefaultCopySpec$DefaultCopySpecResolver.walk(DefaultCopySpec.java:707) at org.gradle.api.internal.file.copy.DefaultCopySpec$DefaultCopySpecResolver.walk(DefaultCopySpec.java:709) at org.gradle.api.internal.file.copy.DefaultCopySpec$DefaultCopySpecResolver.walk(DefaultCopySpec.java:709) at org.gradle.api.internal.file.copy.DefaultCopySpec.walk(DefaultCopySpec.java:513) at org.gradle.api.internal.file.copy.DelegatingCopySpecInternal.walk(DelegatingCopySpecInternal.java:282) at org.gradle.api.internal.file.copy.CopySpecBackedCopyActionProcessingStream.process(CopySpecBackedCopyActionProcessingStream.java:38) at org.gradle.api.internal.file.copy.DuplicateHandlingCopyActionDecorator$1.process(DuplicateHandlingCopyActionDecorator.java:44) at org.gradle.api.internal.file.copy.NormalizingCopyActionDecorator$1.process(NormalizingCopyActionDecorator.java:57) at org.gradle.api.internal.file.copy.FileCopyAction.execute(FileCopyAction.java:35) at org.gradle.api.internal.file.copy.NormalizingCopyActionDecorator.execute(NormalizingCopyActionDecorator.java:53) at org.gradle.api.internal.file.copy.DuplicateHandlingCopyActionDecorator.execute(DuplicateHandlingCopyActionDecorator.java:42) at org.gradle.api.internal.file.copy.CopyActionExecuter.execute(CopyActionExecuter.java:40) at org.gradle.api.tasks.AbstractCopyTask.copy(AbstractCopyTask.java:179) at org.gradle.language.jvm.tasks.ProcessResources.copy(ProcessResources.java:35) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26) at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:801) at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:768) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99) ... 31 more Caused by: groovy.lang.MissingPropertyException: No such property: loader_version for class: SimpleTemplateScript6 at SimpleTemplateScript6.run(SimpleTemplateScript6.groovy:1) at org.gradle.api.internal.file.copy.FilterChain$3.transform(FilterChain.java:121) at org.gradle.api.internal.file.copy.FilterChain$3.transform(FilterChain.java:110) at org.gradle.api.internal.ChainingTransformer.transform(ChainingTransformer.java:37) at org.gradle.api.internal.file.copy.FilterChain.transform(FilterChain.java:56) at org.gradle.api.internal.file.copy.FilterChain.transform(FilterChain.java:64) at org.gradle.api.internal.file.copy.DefaultFileCopyDetails.open(DefaultFileCopyDetails.java:93) at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:56) at org.gradle.api.internal.file.copy.DefaultFileCopyDetails.copyTo(DefaultFileCopyDetails.java:101) at org.gradle.api.internal.file.AbstractFileTreeElement.copyFile(AbstractFileTreeElement.java:93) at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:74) ... 75 more
-
At the moment I'm using Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection("String here"), null); But, it's giving a java.awt.HeadlessException: at sun.awt.HeadlessToolkit.getSystemClipboard(HeadlessToolkit.java:309) I've checked some source code and It's pretty much identical. Does anyone know what is causing this and how I could solve it?
-
Okay, managed to find the solution. under minecraft/runs/client I set args to '--username', 'Insert EMAIL Here', '--password', 'Insert Password Here' and then runClient. I didn't need to genIntellijRuns.