Jump to content

Projectile Entity Constructor Missing Access Level Modifier Preventing Direct Extension


Iron1601

Recommended Posts

Even though some classes extend ProjectileEntity, its constructor is protected. I tried extending it and my IDE told me I needed a "constructor matching super" so I made one but of-course the constructor is protected so a super() is not an option. Am I missing something or is there no way to directly extend ProjectileEntity?

 

Thanks in advance

Edited by Iron1601
Link to comment
Share on other sites

Quote

'ProjectileEntity(net.minecraft.entity.EntityType<? extends net.minecraft.entity.projectile.ProjectileEntity>, net.minecraft.world.World)' is not public in 'net.minecraft.entity.projectile.ProjectileEntity'. Cannot be accessed from outside package

Thanks for the suggestion I tried it and the IDE gave me ^ that. To me this sounds like its not public in the class itself let alone extending classes. Regardless this seems like a mistake of some sort since it is highly unusual to not have a modifier.

 

Link to comment
Share on other sites

 So this?

Quote

public net.minecraft.entity.projectile.ProjectileEntity <init>(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World)

If yes the error is now

Quote

Could not find net.minecraftforge:forge:1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_8792c...

 

Edited by Iron1601
Link to comment
Share on other sites

Quote

Could not resolve all files for configuration ':compileClasspath'.
> Could not find net.minecraftforge:forge:1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451.
  Searched in the following locations:
    - https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451/forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451.pom
    - https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451/forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451.jar
    - file:/C:/Users/Iftach/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451/forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451.pom
    - file:/C:/Users/Iftach/.gradle/caches/forge_gradle/bundeled_repo/net/minecraftforge/forge/1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451/forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451.jar
    - https://libraries.minecraft.net/net/minecraftforge/forge/1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451/forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451.jar
    - https://repo.maven.apache.org/maven2/net/minecraftforge/forge/1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451/forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451.pom
    - https://repo.maven.apache.org/maven2/net/minecraftforge/forge/1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451/forge-1.16.4-35.1.4_mapped_snapshot_20201028-1.16.3_at_7f64862d2fbb7783bd9b00c37ce20f3f46067451.jar
  Required by:
      project :

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

 

Link to comment
Share on other sites

I would imagine this means there is something wrong with the line since puttin a space between the "private com.example.examplemod" and the "<init>" fixes it.

I guess this means there is some syntax problem with 

Quote

public net.minecraft.entity.projectile.ProjectileEntity <init>(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)

Same error on both to be clear

 

I see now it says "Syntax error" so I guess there's that but what error?

Edited by Iron1601
Link to comment
Share on other sites

Im confident you can AT your own mod so long as you dont actively mess something up.


My entire AT is the one line

Quote

public net.minecraft.entity.projectile.ProjectileEntity <init>(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)

Not sure what an update error log is? updated?

Link to comment
Share on other sites

What's the return type of a constructor? stack overflow says void which by the forge docs means that no return type is needed?

 

And yes I agree there is no reason to AT your code but this was just a temporary measure just to not cause any other errors.

 

This is the :comileJava error message I'm assuming that's what you mean. I cant really find any log file in the run/logs or logs  folders that seems relevant.

log,txt

Link to comment
Share on other sites

Quote

No idea why the docs say that, it is not true

So I do need a return type in the AT.

Quote

What?

I made a new project to make sure the only things that could be a problem was the AT and AT'd the Mod class to not mess with minecraft or forge's internal libraries. In general I don't think that matters a whole lot since that doesn't seem to be the problem.

Link to comment
Share on other sites

I'm looking to make the constructor of ProjectileEntity public or at least protected and im getting

Quote

line 1:30 no viable alternative at input 'public net.minecraft.entity.projectile.ProjectileEntity <init>(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)'
Exception in thread "main" java.lang.RuntimeException: 
    at net.minecraftforge.accesstransformer.parser.AtParserErrorListener.syntaxError(AtParserErrorListener.java:8)

which to me means that there is a syntax error.  I haven't managed to locate the problem.

Any help would be appreciated.

Link to comment
Share on other sites

I apologize for this dragging on however, it appears the winning formula is 

Quote

public net.minecraft.entity.projectile.ProjectileEntity <init>(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)V

With your context clues, other AT's and patience I found this working.

Thanks for the help.

Link to comment
Share on other sites

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



×
×
  • Create New...

Important Information

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