Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.15.2]Why am I getting this error?
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
LeiteDesnatado

[1.15.2]Why am I getting this error?

By LeiteDesnatado, November 18, 2020 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

LeiteDesnatado    0

LeiteDesnatado

LeiteDesnatado    0

  • Tree Puncher
  • LeiteDesnatado
  • Members
  • 0
  • 14 posts
Posted November 18, 2020

I'm making an entity and I'm getting this error in the class ModEntityTypes in the entity penguin when registering it (before I created the penguin entity my another entity was working fine)

 

Error  in eclipse: https://prnt.sc/vlmsev

 

Github: https://github.com/LeiteDesnatado/Mod

 

Class ModEntityTypes: https://pastebin.com/U8qnCFCd

 

Class PenguinEntity: https://pastebin.com/mQfPtiYu

  • Quote

Share this post


Link to post
Share on other sites

poopoodice    114

poopoodice

poopoodice    114

  • Dragon Slayer
  • poopoodice
  • Members
  • 114
  • 904 posts
Posted November 18, 2020

It looked right, for me at least.

  • Quote

Share this post


Link to post
Share on other sites

ChampionAsh5357    162

ChampionAsh5357

ChampionAsh5357    162

  • World Shaper
  • ChampionAsh5357
  • Members
  • 162
  • 1024 posts
Posted November 19, 2020

A simple case of generics. You are specifying that the type must be at least that of AnimalEntity. Therefore, you cannot guarantee that the generic is a PenguinEntity.

  • Like 1
  • Quote

Share this post


Link to post
Share on other sites

LeiteDesnatado    0

LeiteDesnatado

LeiteDesnatado    0

  • Tree Puncher
  • LeiteDesnatado
  • Members
  • 0
  • 14 posts
Posted November 19, 2020
28 minutes ago, ChampionAsh5357 said:

A simple case of generics. You are specifying that the type must be at least that of AnimalEntity. Therefore, you cannot guarantee that the generic is a PenguinEntity.

How could I fix that?

  • Quote

Share this post


Link to post
Share on other sites

ChampionAsh5357    162

ChampionAsh5357

ChampionAsh5357    162

  • World Shaper
  • ChampionAsh5357
  • Members
  • 162
  • 1024 posts
Posted November 19, 2020

Specify the generic parameter to be a subclass of PenguinEntity instead of AnimalEntity

  • Like 1
  • Quote

Share this post


Link to post
Share on other sites

LeiteDesnatado    0

LeiteDesnatado

LeiteDesnatado    0

  • Tree Puncher
  • LeiteDesnatado
  • Members
  • 0
  • 14 posts
Posted November 19, 2020

 

9 hours ago, ChampionAsh5357 said:

Specify the generic parameter to be a subclass of PenguinEntity instead of AnimalEntity

It worked thank you!

  • Quote

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      I am getting an error

      By diesieben07 · Posted 48 minutes ago

      1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • Keigo
      I am getting an error

      By Keigo · Posted 49 minutes ago

      there  
    • Keigo
      I am getting an error

      By Keigo · Posted 49 minutes ago

      debug.log
    • diesieben07
      Can't download pixelmon

      By diesieben07 · Posted 50 minutes ago

      1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • diesieben07
      Task :runClient FAILED | Build failed with an exeption.

      By diesieben07 · Posted 51 minutes ago

      1.14 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  • Topics

    • Keigo
      6
      I am getting an error

      By Keigo
      Started 4 hours ago

    • shimmy360@gmail.com
      1
      Can't download pixelmon

      By shimmy360@gmail.com
      Started 59 minutes ago

    • IchBinEinToast
      1
      Task :runClient FAILED | Build failed with an exeption.

      By IchBinEinToast
      Started 1 hour ago

    • CrooKameron
      1
      my all mod's didn't working :(

      By CrooKameron
      Started 17 hours ago

    • Luis_ST
      1
      [1.16.5] [Bug?] Enchantments can Apply to all Tools

      By Luis_ST
      Started 2 hours ago

  • Who's Online (See full list)

    • Sr. Qwertz
    • diesieben07
    • <Gl33p_0r4nge>
    • coolsim
    • LexManos
    • Trhod177
    • yumeji
    • zOnlyKroks
    • XX_KIng_YT
    • MostafaSabry55
    • Novârch
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.15.2]Why am I getting this error?
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community