Jump to content

Skelyvelocirap

Members
  • Posts

    51
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Skelyvelocirap

  1. Alright well i have absolutely no clue what happened but i saw that yet somehow misread resource location as... frankly i have no clue what. And the only thing i have to say about this is... UGHHHHHHHHHHHHHHHHHHHHH. I was about to say that it still didn't work but as it turns out i just had an if statement that was made to check for something irrelevent. It wouldn't have changed the fact that i needed to ask help for this but could at least have save me quite a few minutes of headaches. Either way thank you it works perfectly now! I haven't tested it with modded biomes yet so ill just ask instead, Registries#BIOME does detect modded biomes as well correct? I know that in older versions vanilla and modded registries were seperated. Although thank you once again for the help!
  2. Alright, so. I tried looking through the topic you sent and i can't quite figure it out. The thing is that its converting a Biome to a Holder<Biome> which isn't quite what i need it to do. The actual problem im having is the i need to store the Biome as NBT and somehow retrive it. The only way i can think of doing that is with the registryName which if memory serves me right was able to be used to get a biome with and the biome could be used to get that. I assume that it uses the Registries#BIOME which i believe you mentioned, but im not quite sure what to do from there as there doesn't seem to be any usefull methods for it. It's been a while since ive worked with forge so im sorry if im just failing at something simple.
  3. Huh. I have no clue why i couldn't find those then. My google results have always been terrible so that might be why. Either way, i actually realized i had asked the same question for 1.16 so i kinda had a hint as for what to look for except i would never have guessed they changed that class too. Either way thanks for the help and ill go and try that out right now
  4. I need to store a biome as NBT for an item. Unfortunately that does not seem to be possible, and even if it were if would probably be horribly inneficient. So I decided to opt for a different method. I want to try and store the name of the biome instead, or an ID of some sort. The issue is that whatever i try it never seems to work. I tried looking for some sort of getName() function inside of the Biome class to no avail. I also tried to use ForgeRegistries.BIOMES.getKey(biome).getPath(); And other similar functions such as using the resourceKey and resource location but for some reason those simply return an empty string. I did verify and biome is an actual biome. Please help me ive been stuck on this problem for about 2 days now and no one seems to have had this problem before, at least not in 1.19.
  5. Alright so, ive gotten it to work but now im a bit confused as to how i add items to the inventory. Im guessing its not as simple as inventoryHandler#setStackInSlot() is it? Would this add it to the item or itemstack?
  6. I am really confused tbh. How exactly am I supposed to do that?
  7. How do i check the type of capability its returning for with this method though?
  8. Alright, how would i use that then?
  9. Hmmm, it still doesn't work. The type ParcelItem does not define ParcelItem() that is applicable here Im guessing this is due to the argument in the constructor but im not really sure how to fix that.
  10. public class ParcelItem extends Item implements ICapabilityProvider { LazyOptional<ItemStackHandler> inventoryHandler = LazyOptional.of(this); public ParcelItem(Properties properties) { super(properties); } @Override public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { if(cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { return inventoryHandler.cast(); } return null; } } Alright, i will make sure to use that instead, although, this is currently what I have. From the docs i understand i have to use a lazy optional and use the IItemHandler(im guessing replacing it with ItemStackHandler is fine consider it uses IItemHandler as a base). I thought i could pass the class as the supplier though but it seems i was mistaken. What exactly am i supposed to pass to it? Am i even supposed to do it like this?
  11. Ohhhhhhh, thats how you get access to those methods. I knew you used to get those in 1.12.2 but completely forgot how, that answers that! So now i simply add an IInventory to the item along with implementing the capability right?
  12. This is pretty self explanatory but i am trying to attach an inventory to one of my items. I know that i should be using capabilities for this but I'm not sure where i should put it for an item. Would it go inside of initCapabilities(), and if so how would i use that? I tried to take a look at how other mods do this but every mod seems to do it a different way and all of which require some kind of GUI(which I do not want). Of course there is the forge docs but their isn't enough documentations for doing so to items, it mostly explains for tile entities. Anything else i could find is too old to be any use with the complete API reworks basically every other version. Could someone help me with this? I was able to solve this issue last time i encountered it by simply adding the name of the stored item to the nbt but I'm afraid this wont work for this as I need to be able to have more than one slots.
  13. Oops, my bad. I accidentally put it in the wrong spot. It works just fine now! Thank you very much for your help!
  14. Hmmm, for some reason it doesn't work. I know the password and username are both correct and i did exactly what i just mentioned. Am i supposed to run something other than genEclipseRuns?
  15. So for the latter, would this be correct? args '--username', 'insert_username' For the former though, its simply just writing a variable? So something like that: password_variable="this_is_my_password" And then using this as the value for args?
  16. How am i supposed to do both those things? Sorry, i cannot find any resources on gradle and such so i have basically no experience with it.
  17. That's quite odd. Then what am i doing wrong? Is it not supposed to go in Program arguments in the arguments tab in run configurations? This is what is says(i replaced the username and password for obvious reasons) Launching Gradle tasks failed due to an error connecting to the Gradle build. Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-6.8.1-all.zip'. Problem with provided build arguments: [--username=insert_username, --password=insert_password]. Unknown command-line option '--username'. Either it is not a valid build option or it is not supported in the target Gradle version. Not all of the Gradle command line options are supported build arguments. Examples of supported build arguments: '--info', '-p'. Examples of unsupported build options: '--daemon', '-?', '-v'. Please find more information in the javadoc for the BuildLauncher class. Problem with provided build arguments: [--username=insert_username, --password=insert_password]. Unknown command-line option '--username'. Either it is not a valid build option or it is not supported in the target Gradle version. Not all of the Gradle command line options are supported build arguments. Examples of supported build arguments: '--info', '-p'. Examples of unsupported build options: '--daemon', '-?', '-v'. Please find more information in the javadoc for the BuildLauncher class. Unknown command-line option '--username'. org.gradle.tooling.exceptions.UnsupportedBuildArgumentException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-6.8.1-all.zip'. Problem with provided build arguments: [--username=insert_username, --password=insert_password]. Unknown command-line option '--username'. Either it is not a valid build option or it is not supported in the target Gradle version. Not all of the Gradle command line options are supported build arguments. Examples of supported build arguments: '--info', '-p'. Examples of unsupported build options: '--daemon', '-?', '-v'. Please find more information in the javadoc for the BuildLauncher class. at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:39) at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29) at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41) at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46) at org.gradle.tooling.internal.consumer.DefaultBuildLauncher.run(DefaultBuildLauncher.java:77) at sun.reflect.GeneratedMethodAccessor172.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.buildship.core.workspace.internal.ConnectionAwareLauncherProxy.invokeRun(ConnectionAwareLauncherProxy.java:170) at org.eclipse.buildship.core.workspace.internal.ConnectionAwareLauncherProxy.invoke(ConnectionAwareLauncherProxy.java:160) at com.sun.proxy.$Proxy67.run(Unknown Source) at org.eclipse.buildship.core.launch.RunGradleBuildLaunchRequestJob.executeLaunch(RunGradleBuildLaunchRequestJob.java:86) at org.eclipse.buildship.core.launch.RunGradleBuildLaunchRequestJob.executeLaunch(RunGradleBuildLaunchRequestJob.java:45) at org.eclipse.buildship.core.launch.BaseLaunchRequestJob.runToolingApiJob(BaseLaunchRequestJob.java:82) at org.eclipse.buildship.core.util.progress.ToolingApiJob$1.run(ToolingApiJob.java:73) at org.eclipse.buildship.core.util.progress.ToolingApiInvoker.invoke(ToolingApiInvoker.java:62) at org.eclipse.buildship.core.util.progress.ToolingApiJob.run(ToolingApiJob.java:70) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56) Caused by: org.gradle.tooling.internal.protocol.exceptions.InternalUnsupportedBuildArgumentException: Problem with provided build arguments: [--username=insert_username, --password=insert_password]. Unknown command-line option '--username'. Either it is not a valid build option or it is not supported in the target Gradle version. Not all of the Gradle command line options are supported build arguments. Examples of supported build arguments: '--info', '-p'. Examples of unsupported build options: '--daemon', '-?', '-v'. Please find more information in the javadoc for the BuildLauncher class. at org.gradle.tooling.internal.provider.ProviderStartParameterConverter.toStartParameter(ProviderStartParameterConverter.java:82) at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:141) at org.gradle.tooling.internal.provider.DefaultConnection.getModel(DefaultConnection.java:202) at org.gradle.tooling.internal.consumer.connection.CancellableModelBuilderBackedModelProducer.produceModel(CancellableModelBuilderBackedModelProducer.java:53) at org.gradle.tooling.internal.consumer.connection.PluginClasspathInjectionSupportedCheckModelProducer.produceModel(PluginClasspathInjectionSupportedCheckModelProducer.java:41) at org.gradle.tooling.internal.consumer.connection.AbstractConsumerConnection.run(AbstractConsumerConnection.java:58) at org.gradle.tooling.internal.consumer.connection.ParameterValidatingConsumerConnection.run(ParameterValidatingConsumerConnection.java:46) at org.gradle.tooling.internal.consumer.DefaultBuildLauncher$1.run(DefaultBuildLauncher.java:89) at org.gradle.tooling.internal.consumer.DefaultBuildLauncher$1.run(DefaultBuildLauncher.java:83) at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:84) at org.gradle.tooling.internal.consumer.connection.CancellableConsumerActionExecutor.run(CancellableConsumerActionExecutor.java:45) at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58) at org.gradle.tooling.internal.consumer.connection.RethrowingErrorsConsumerActionExecutor.run(RethrowingErrorsConsumerActionExecutor.java:38) at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:55) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.gradle.cli.CommandLineArgumentException: Unknown command-line option '--username'. at org.gradle.cli.CommandLineParser$BeforeFirstSubCommand.onStartOption(CommandLineParser.java:319) at org.gradle.cli.CommandLineParser.parse(CommandLineParser.java:92) at org.gradle.tooling.internal.provider.ProviderStartParameterConverter.toStartParameter(ProviderStartParameterConverter.java:78) ... 18 more
  18. I know this was possible in earlier versions but for some reason, adding --username=[my username here] and --password[my password here] to the program run arguments doesn't work. Im guessing it has to do with the fact that now you log in with the Dev account. Is there a way to use my own account, and if so how?
  19. Im trying to add support for crafttweaker but for some reason its not actually being used as a dependency. Im new to this gradle stuff and i can't find any documentation on it, so I'm completely stumped. Anyways, i added the maven repo and the dependency to the build.gradle file but for some reason its not added. The project says that the build was successful when I run gradlew genEclipseRuns. buildscript { repositories { maven { url = 'https://files.minecraftforge.net/maven' } mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true } } apply plugin: 'net.minecraftforge.gradle' // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. apply plugin: 'eclipse' apply plugin: 'maven-publish' version = '1.16.5-1.0.0' group = 'skelyvelocirap.panning' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'panning' java.toolchain.languageVersion = JavaLanguageVersion.of(8) // Mojang ships Java 8 to end users, so your mod should target Java 8. println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) minecraft { // The mappings can be changed at any time, and must be in the following format. // Channel: Version: // snapshot YYYYMMDD Snapshot are built nightly. // stable # Stables are built at the discretion of the MCP team. // official MCVersion Official field/method names from Mojang mapping files // // You must be aware of the Mojang license when using the 'official' mappings. // See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md // // Use non-default mappings at your own risk. they may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. mappings channel: 'official', version: '1.16.5' // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Default run configurations. // These can be tweaked, removed, or duplicated as needed. runs { client { workingDirectory project.file('run') // Recommended logging data for a userdev environment // The markers can be changed as needed. // "SCAN": For mods scan. // "REGISTRIES": For firing of registry events. // "REGISTRYDUMP": For getting the contents of all registries. property 'forge.logging.markers', 'REGISTRIES' // Recommended logging level for the console // You can set various levels here. // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels property 'forge.logging.console.level', 'debug' mods { panning { source sourceSets.main } } } server { workingDirectory project.file('run') // Recommended logging data for a userdev environment // The markers can be changed as needed. // "SCAN": For mods scan. // "REGISTRIES": For firing of registry events. // "REGISTRYDUMP": For getting the contents of all registries. property 'forge.logging.markers', 'REGISTRIES' // Recommended logging level for the console // You can set various levels here. // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels property 'forge.logging.console.level', 'debug' mods { panning { source sourceSets.main } } } data { workingDirectory project.file('run') // Recommended logging data for a userdev environment // The markers can be changed as needed. // "SCAN": For mods scan. // "REGISTRIES": For firing of registry events. // "REGISTRYDUMP": For getting the contents of all registries. property 'forge.logging.markers', 'REGISTRIES' // Recommended logging level for the console // You can set various levels here. // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels property 'forge.logging.console.level', 'debug' // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. args '--mod', 'panning', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') mods { panning { source sourceSets.main } } } } } // Include resources generated by data generators. sourceSets.main.resources { srcDir 'src/generated/resources' } repositories { maven { // JARED MAVEN name 'Jared maven' url 'https://maven.blamejared.com/' } } dependencies { minecraft 'net.minecraftforge:forge:1.16.5-36.1.0' //Craft tweaker dependency compile fg.deobf("com.blamejared.crafttweaker:CraftTweaker-1.16.5:7.1.0.99") } // Example for how to get properties into the manifest for reading by the runtime.. jar { manifest { attributes([ "Specification-Title": "examplemod", "Specification-Vendor": "examplemodsareus", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"examplemodsareus", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } } // Example configuration to allow publishing using the maven-publish task // This is the preferred method to reobfuscate your jar file jar.finalizedBy('reobfJar') // However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing //publish.dependsOn('reobfJar') publishing { publications { mavenJava(MavenPublication) { artifact jar } } repositories { maven { url "file:///${project.projectDir}/mcmodsrepo" } } } This is my build.gradle file, am i doing something wrong?
  20. Sweet, it works perfectly now! Im now returning pass instead of consume and updating the progress every 3 ticks. Thank you very much for your help, now my item works exactly like i want it to! Thank you again!
  21. Oops, I forgot I switched to ActionResult#sidedSuccess. And thank you for noticing it was backwards. Although this isn't really the problem. My item is ALWAYS doing that, even if the condition is false(the if statements before it). When the player is not in the correct liquids it should return ActionResult#consume(which it does) but it still swings the players arms. I know this for sure as you might notice that its logging the item in the pan(which i forgot to remove...).
  22. https://github.com/skelyvelocirap/panning/blob/main/src/main/java/skelyvelocirap/panning/items/PanItem.java This should point you right to it. I made sure to have a github repo for times like these. Also thank you, this is going to help greatly!
  23. Oops, i didn't submit it. Alright! Ok, well it seems to work exactly how i want it to currently! Although, for some reason it still swings the players arms even though im returning ActionResult#consume(stack). Am i supposed to override that somewhere else as well? Also, this isn't 100% related but what would I need to override to add an animation to the item? I don't mean how do I make an animation(don't quite know how but i should be able to find it on google), rather how do I make it play when the item is held down. I now know that for the items it would be the Item#onUseTick. Is there a similar method for the animation?
  24. Alright. So ActionResult basically just tells Minecraft whether or not to swing the hand, along with whether or not it should process the item further(so inhibiting other items from doing their thing instead). And so I would simply check(in Item#use) if LivingEntity#getUseItemRemainingTicks is greater than 0, if it is than return Consume, or else success? For the Item#useOnRelease, i dont think i will do that as what im trying to do is wait until the 5 seconds have passed. If i return true then the user could just spam right click and get it over with.
  25. So that's how those work! Alright, thank you! Its now working perfectly! Although one last question. Item#use() needs you to return an Action result. I never really understood those and mostly just copied what others did. My guess is that its what is responsible for the hand movement when you right click(am I correct?). If it is, how exactly would I fix it so that it only does that once Item#onUseTick's tick parameter is 0? EDIT: Alright so, I'm now using Item#finishUsingItem as there is no need to run my logic every tick. Hopefully this will reduce the already non-existent lag.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.