Jump to content

Recommended Posts

Posted

i saw this in a mod(the code is written in 1.16.5) but is giving me erros, it doesnt find player.playerInfo and playerInfo.playerTexturesLoaded, in the class that was made it doesnt extends anything

public static void setPlayerSkin(AbstractClientPlayerEntity player, ResourceLocation texture) {
        if (player.getLocationSkin().equals(texture)) {
            return;
        }
        NetworkPlayerInfo playerInfo = player.playerInfo;
        if (playerInfo == null) return;
        Map<MinecraftProfileTexture.Type, ResourceLocation> playerTextures = playerInfo.playerTextures;
        playerTextures.put(MinecraftProfileTexture.Type.SKIN, texture);
        if (texture == null) {
            playerInfo.playerTexturesLoaded = false;
        }
    }

 

Posted
59 minutes ago, poopoodice said:

They are private, and that explains why your IDE can't "find" it.

If you navigate to the class you should see them, and in this case they probably made it visible (public) by using access transformers.

I know this is basic java knowledge but PLEASE tell me a solution, i already learned java but i never imagined how i can use public, private and protected(obviusly i use them but i dont know how to connect private fieds so my class) im BEGGING YOU tell me how, i tried some tutorials of how to access to private fields but it wasnt helpful

Posted
1 hour ago, poopoodice said:

Did you had a look at the link to the Forge doc I attached?

i wrote the accessmodifier thing, refreshed the build.gradle file and even restarted my idle but it didnt worked, i checked the location of where the .cfg file should be but there is nothing(src/main/resources/META-INF/accesstransformer.cfg), there is only the mods.toml

Posted
2 hours ago, poopoodice said:

Did you had a look at the link to the Forge doc I attached?

hi i made the accesstransformer.cfg file with the text it needs for what im doing, but i dont know how to refresh the gradle project, in eclipse you right click in the project, gradle and refresh gradle project but im using intellij and all the tutorials for accesstransformers are made for eclipse

#AbstractClientPlayerEntity
public net.minecraft.client.entity.player.AbstractClientPlayerEntity field_175157_a # playerInfo

#NetworkPlayerInfo
public net.minecraft.client.network.play.NetworkPlayerInfo field_187107_a # playerTextures
public net.minecraft.client.network.play.NetworkPlayerInfo field_178864_d # playerTexturesLoaded
public net.minecraft.client.network.play.NetworkPlayerInfo func_178841_j()V # loadPlayerTextures
public net.minecraft.client.network.play.NetworkPlayerInfo field_178867_a # gameProfile

 

Posted (edited)

1. There's "relaod button" on the gradle panel (mine is located on the upper right side).

2. Or in the "search everywhere" type "Reload All Gradle Projects"

3. Or close the IDE, delete .idea folder, and re-import the project.

 

Edited by poopoodice
Posted
1 hour ago, poopoodice said:

1. There's "relaod button" on the gradle panel (mine is located on the upper right side).

2. Or in the "search everywhere" type "Reload All Gradle Projects"

3. Or close the IDE, delete .idea folder, and re-import the project.

 

thank you :), hey "your button that is located on the upper right side", does it do the same as the "Reload All Gradle Projects" in search everywhere?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Im trying to build my mod using shade since i use the luaj library however i keep getting this error Reason: Task ':reobfJar' uses this output of task ':shadowJar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. So i try adding reobfJar.dependsOn shadowJar  Could not get unknown property 'reobfJar' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. my gradle file plugins { id 'eclipse' id 'idea' id 'maven-publish' id 'net.minecraftforge.gradle' version '[6.0,6.2)' id 'com.github.johnrengelman.shadow' version '7.1.2' id 'org.spongepowered.mixin' version '0.7.+' } apply plugin: 'net.minecraftforge.gradle' apply plugin: 'org.spongepowered.mixin' apply plugin: 'com.github.johnrengelman.shadow' version = mod_version group = mod_group_id base { archivesName = mod_id } // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. java.toolchain.languageVersion = JavaLanguageVersion.of(17) //jarJar.enable() println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}" minecraft { mappings channel: mapping_channel, version: mapping_version copyIdeResources = true runs { configureEach { workingDirectory project.file('run') property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' arg "-mixin.config=derp.mixin.json" mods { "${mod_id}" { source sourceSets.main } } } client { // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. property 'forge.enabledGameTestNamespaces', mod_id } server { property 'forge.enabledGameTestNamespaces', mod_id args '--nogui' } gameTestServer { property 'forge.enabledGameTestNamespaces', mod_id } data { workingDirectory project.file('run-data') args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') } } } sourceSets.main.resources { srcDir 'src/generated/resources' } repositories { flatDir { dirs './libs' } maven { url = "https://jitpack.io" } } configurations { shade implementation.extendsFrom shade } dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" implementation 'org.luaj:luaj-jse-3.0.2' implementation fg.deobf("com.github.Virtuoel:Pehkui:${pehkui_version}") annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' minecraftLibrary 'luaj:luaj-jse:3.0.2' shade 'luaj:luaj-jse:3.0.2' } // Example for how to get properties into the manifest for reading at runtime. tasks.named('jar', Jar).configure { manifest { attributes([ 'Specification-Title' : mod_id, 'Specification-Vendor' : mod_authors, 'Specification-Version' : '1', // We are version 1 of ourselves 'Implementation-Title' : project.name, 'Implementation-Version' : project.jar.archiveVersion, 'Implementation-Vendor' : mod_authors, 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", "TweakOrder" : 0, "MixinConfigs" : "derp.mixin.json" ]) } rename 'mixin.refmap.json', 'derp.mixin-refmap.json' } shadowJar { archiveClassifier = '' configurations = [project.configurations.shade] finalizedBy 'reobfShadowJar' } assemble.dependsOn shadowJar reobf { re shadowJar {} } publishing { publications { mavenJava(MavenPublication) { artifact jar } } repositories { maven { url "file://${project.projectDir}/mcmodsrepo" } } }  
    • All versions of Minecraft Forge suddenly black screen even without mods (tried reinstalling original Minecraft, Java, updating drivers doesn't work)
    • When i join minecraft all ok, when i join world all working fine, but when i open indentity menu, i get this The game crashed whilst unexpected error Error: java.lang.NullPointerException: Cannot invoke "top.ribs.scguns.common.Gun$Projectile.getDamage()" because "this.projectile" is null crash report here https://paste.ee/p/0vKaf
  • Topics

×
×
  • Create New...

Important Information

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