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.7.10] @SideOnly(Side.CLIENT) Not use it anymore?
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
American2050

[1.7.10] @SideOnly(Side.CLIENT) Not use it anymore?

By American2050, August 29, 2015 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

American2050    11

American2050

American2050    11

  • Dragon Slayer
  • American2050
  • Members
  • 11
  • 541 posts
Posted August 29, 2015

I can't remember where but I think I read that @SideOnly(Side.CLIENT) shouldn't be used anymore.

 

My question is, wherever I have things like this:

	@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
itemIcon = iconRegister.registerIcon(this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
}

 

I should modify them like

 

	if(!world.isRemote)
	{
		itemIcon = iconRegister.registerIcon(this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
	}

 

But what happens when I don't have "world" available to use, like in this case?

 

 

  • Quote

Share this post


Link to post
Share on other sites

Failender    119

Failender

Failender    119

  • World Shaper
  • Failender
  • Forge Modder
  • 119
  • 1091 posts
Posted August 29, 2015

http://www.minecraftforge.net/forum/index.php/topic,22764.0.html

 

EDIT: thats the general answer for it. but there are things that are already client only, like icons, so keep using things like vanilla did

  • Quote

Share this post


Link to post
Share on other sites

American2050    11

American2050

American2050    11

  • Dragon Slayer
  • American2050
  • Members
  • 11
  • 541 posts
Posted August 29, 2015

Thanks going to read it ;)

Hopefully that clarifies my confusion

  • Quote

Share this post


Link to post
Share on other sites

WitherBoss2000    2

WitherBoss2000

WitherBoss2000    2

  • Tree Puncher
  • WitherBoss2000
  • Members
  • 2
  • 25 posts
Posted August 30, 2015

I am pretty sure you cant have 2 annotations with the @SideOnly, you  dont need the overide. Maybe put the override below the @sideonly for some strange reason. This happens to me too. Trust me, it still works in 1.8

 

  • Quote

I AM SUS

Share this post


Link to post
Share on other sites

Choonster    1651

Choonster

Choonster    1651

  • Reality Controller
  • Choonster
  • Forge Modder
  • 1651
  • 5097 posts
Posted August 30, 2015

I am pretty sure you cant have 2 annotations with the @SideOnly, you  dont need the overide. Maybe put the override below the @sideonly for some strange reason. This happens to me too. Trust me, it still works in 1.8

You can use as many annotations as you want. You should always use

@Override

when overriding a method and

@SideOnly

when overriding a method with

@SideOnly

.

  • Quote

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Thorius
      [1.15.2] How Would I make a custom bow?

      By Thorius · Posted 3 minutes ago

      You have to create a new bullet entity class but you can use the snowball as a template. In kinematics there's not much difference between a snowball and a bullet. If it looks and hurts like a bullet then it's a bullet. But you have to register it as a new entity.
    • Ipsissimus418
      [1.16.4] WorldTickEvent Concurrent Access Exception

      By Ipsissimus418 · Posted 21 minutes ago

      That is something I hadn't considered in terms of threads.   I have the WorldTickEvent handler do nothing on the client but run on the server. I may have some paths for the addEntry running on both the client and server. Something I need to look into and check if that is where the conflict is coming from.   Thanks.
    • kiou.23
      [1.16] Custom Sign won't render

      By kiou.23 · Posted 26 minutes ago

      Did the classes, now the edit screen shows up, and if I use a vanilla WoodType for the sign, the texture shows up in the edit screen (not in the actual block tho, it still won't render) the changes are on github. How should I go about rendering the Sign again? I'll need to write my own TileEntityRenderer?
    • PedreHenrry
      my minecraft crashed by "rendering overlay"

      By PedreHenrry · Posted 30 minutes ago

      i fixed it re instaling the forge after delete it  
    • Somonestolemyusername
      [1.15.2] How Would I make a custom bow?

      By Somonestolemyusername · Posted 40 minutes ago

      but if I use the snowball class it will be like im shooting snowballs not bullets. you know mr crayfishes gun mod? i want my gun to be somewhat like that also i figured out how to connect my registered object to the class
  • Topics

    • Somonestolemyusername
      14
      [1.15.2] How Would I make a custom bow?

      By Somonestolemyusername
      Started Tuesday at 09:30 PM

    • Ipsissimus418
      2
      [1.16.4] WorldTickEvent Concurrent Access Exception

      By Ipsissimus418
      Started 1 hour ago

    • kiou.23
      14
      [1.16] Custom Sign won't render

      By kiou.23
      Started 10 hours ago

    • PedreHenrry
      5
      my minecraft crashed by "rendering overlay"

      By PedreHenrry
      Started Yesterday at 01:06 PM

    • e2rifia
      2
      (1.16.2) Making a new capability(2)

      By e2rifia
      Started 57 minutes ago

  • Who's Online (See full list)

    • Bailym
    • Thorius
    • Somonestolemyusername
    • Minnifloyd
    • Funyaah
    • Beethoven92
    • kiou.23
    • Choonster
    • Cheesebobby
    • JackRaidenPH
    • Ipsissimus418
    • Niprow
    • Danebi
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.7.10] @SideOnly(Side.CLIENT) Not use it anymore?
  • Theme

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