Jump to content

Recommended Posts

Posted

Hi Guys,

 

I´m DealerJoe and I´m new on this forum so please correct me if I do anything wrong.

Yesterday, I tried to change over from ModLoader to Forge.

 

Now my Problem:

 

I´ve got a mod which creates a new Block with a custom rendered BlockModel. Everything works in Singleplayer, but when I try to start the server with my mod, I get the following exception :

 

Description: Exception in server tick loop

java.lang.NoClassDefFoundError: net/minecraft/src/TileEntitySpecialRenderer
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Unknown Source)
   at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:407)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
   at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
   at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
   at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
   at com.google.common.eventbus.EventBus.post(EventBus.java:268)
   at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:124)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
   at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
   at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
   at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
   at com.google.common.eventbus.EventBus.post(EventBus.java:268)
   at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:81)
   at cpw.mods.fml.common.Loader.loadMods(Loader.java:466)
   at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:80)
   at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:340)
   at net.minecraft.src.DedicatedServer.startServer(DedicatedServer.java:49)
   at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:433)
   at net.minecraft.src.ThreadServerApplication.run(ThreadServerApplication.java:18)
Caused by: java.lang.ClassNotFoundException: net.minecraft.src.TileEntitySpecialRenderer
   at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:125)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 29 more
Caused by: java.lang.NullPointerException
   at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:119)
   ... 31 more

 

So, I already looked at the sourcecode of a few other mods which also add custom block models but I couldn´t figure out where I did the mistake.

 

So, these are the Files I have (If I forgot something, please tell me, I´ll show you)

 

 

Mod-Files

 

My mod-file


package farmersfriends.common;


import java.net.Proxy;


import net.minecraft.src.Block;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.ModLoader;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.common.SidedProxy;


@Mod(modid="DealerJoeFM", name="Farmers Friends", version="1.0")
@NetworkMod(clientSideRequired=true, serverSideRequired=false)


public class mod_farmersfriends {


   public static final Block blockChopper = (new BlockChopper(250, TileEntityChopper.class)).setHardness(0.5F).setBlockName("chopperBlock");
   
   public static final Item chopper = (new ItemChopper(5500, blockChopper).setItemName("chopper").setIconIndex(0));
   public static final Item sawmeal = (new ItemSawmeal(5501).setItemName("sawmeal").setIconIndex(1));
   public static final Item farmersScythe = (new ItemScythe(5502).setItemName("farmersScythe").setIconIndex(2));
   public static final Item farmersScytheBloody = (new ItemScythe(5503).setItemName("farmersScytheBloody").setIconIndex(3));


   
   @Init
   public void load(FMLInitializationEvent e){
      GameRegistry.registerFuelHandler(new FuelHandler());
      
      RenderChopper renderChopper = new RenderChopper();


      ClientRegistry.registerTileEntity(TileEntityChopper.class, "TileEntityChopper", renderChopper);
      
      LanguageRegistry.addName(chopper, "Chopper");
      LanguageRegistry.addName(sawmeal, "Sawmeal");
      LanguageRegistry.addName(farmersScythe, "Farmers Scythe");
      LanguageRegistry.addName(farmersScytheBloody, "Farmers Bloody Scythe");
      
      GameRegistry.addRecipe(new ItemStack(chopper, 1), new Object[]{
         "  S","IIW","ILR", 'S', Item.stick, 'I', Item.ingotIron, 'W', Block.wood, 'R', Item.redstone, 'L', Item.leather
      });
      
      CommonProxyFm.proxy.registerRenderThings();
   }
   
}


 

 

My BlockFile

 


package farmersfriends.common;


import java.util.Random;


import net.minecraft.src.Block;
import net.minecraft.src.BlockContainer;
import net.minecraft.src.IBlockAccess;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Material;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;


public class BlockChopper extends BlockContainer{
   private boolean isRunning = false;
   private int time;
   private int timeout = 80;
   
   private Class ChopperEntityClass;
   
   protected BlockChopper(int i, Class gClass){
      super(i, Material.wood);
      ChopperEntityClass = gClass;
   }
   
    public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
    {
       if(isRunning){
          time++;
          System.out.println(time);
       }
       if(time>timeout){
          time = 0;
          isRunning = false;
       }
       
       if(isRunning){
          par1World.spawnParticle("smoke", par2+0.5, par3+1.5, par4+0.5, 0.0D, 0.0D, 0.0D);
       }
    }
    
    public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
    {
       int blockId = par1World.getBlockId(par2, par3+1, par4);
       
       if(blockId == Block.wood.blockID ||blockId == Block.planks.blockID||blockId == Block.sapling.blockID )
       {
          this.isRunning = true;
          
          if(new Random().nextInt(10) < 4){
             ItemStack is = new ItemStack(mod_farmersfriends.sawmeal, 1);
             this.dropBlockAsItem_do(par1World, par2, par3+1, par4, is);
          }
          
          par1World.setBlock(par2, par3+1, par4, 0);
          
            /*mc.installResource("newsound/fm/chopper.ogg", 
                    new File(mc.mcDataDir, "resources/newsound/fm/chopper.ogg"));
          
          mc.sndManager.playSoundFX("fm.chopper", 5.0F, 1.0F);*/
          
          par1World.spawnParticle("smoke", par2, par3, par4, 0.0D, 0.0D, 0.0D);
       }
    }
   
   public int idDropped(int i, Random rand, int j){
      return mod_farmersfriends.chopper.shiftedIndex;
   }
   
   public int quantityDropped(Random rand){
      return 1;
   }
   
   public int getRenderType(){
      return -1;
   }
   
   public boolean isOpaqueCube(){
      return false;
   }
   
   public boolean renderAsNormalBlock(){
      return false;
   }


   @Override
   public TileEntity createNewTileEntity(World var1) {
      return new TileEntityChopper();
   }
}


 

My Render File

 




package farmersfriends.common;


import net.minecraft.src.TileEntity;
import net.minecraft.src.TileEntitySignRenderer;
import net.minecraft.src.TileEntitySpecialRenderer;
import net.minecraftforge.client.ForgeHooksClient;


import org.lwjgl.opengl.GL11;




public class RenderChopper extends TileEntitySpecialRenderer{


   private ModelChopper chopperModel;
   
   public RenderChopper(){
      chopperModel = new ModelChopper();
   }
   
   public void renderChopperModelAt(TileEntityChopper tileentity1, double d, double d1, double d2, float f){
      GL11.glPushMatrix();
      GL11.glTranslatef((float) d + 0.5F,(float) d1 + 1.5F,(float) d2 + 0.5F);
      GL11.glRotatef(180, 0, 0, 180);
      ForgeHooksClient.bindTexture("/farmer/chopper.png", 0);
      GL11.glPushMatrix();
      chopperModel.renderModel(0.0625F);
      GL11.glPopMatrix();
      GL11.glPopMatrix();
   }


   public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) {
      renderChopperModelAt((TileEntityChopper)var1, var2, var4, var6, var8);
   }


}


 

My TileEntityFile

 


package farmersfriends.common;


import net.minecraft.src.TileEntity;


public class TileEntityChopper extends TileEntity
{
   
}


 

The Common Proxy

 


package farmersfriends.common;


import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.registry.GameRegistry;


public class CommonProxyFm {
   @SidedProxy(clientSide = "farmersfriends.client.ClientProxyFm", serverSide = "farmersfriends.common.CommonProxyFm")
   public static CommonProxyFm proxy;   
   
   public void registerRenderThings(){   }
}


 

The Client Proxy

 


package farmersfriends.client;


import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraftforge.client.MinecraftForgeClient;
import farmersfriends.common.CommonProxyFm;
import farmersfriends.common.RenderChopper;
import farmersfriends.common.TileEntityChopper;


public class ClientProxyFm extends CommonProxyFm{
   @Override
    public void registerRenderThings()
    {
      MinecraftForgeClient.preloadTexture("/farmer/items.png");
      MinecraftForgeClient.preloadTexture("/farmer/blocks.png");
      MinecraftForgeClient.preloadTexture("/farmer/chopper.png");
   
      ClientRegistry.bindTileEntitySpecialRenderer(TileEntityChopper.class, new RenderChopper());
      //ClientRegistry.bindTileEntitySpecialRenderer(TileEntityChopper.class, new RenderChopper());
    }


}

 

 

 

 

I would be glad if anybody could help me with that problem.

 

 

Thanks

DealerJoe

Posted

This:

   @SidedProxy(clientSide = "farmersfriends.client.ClientProxyFm", serverSide = "farmersfriends.common.CommonProxyFm")
   public static CommonProxyFm proxy;  

 

goes into your mod class, not in the CommonProxy class.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

This:

   @SidedProxy(clientSide = "farmersfriends.client.ClientProxyFm", serverSide = "farmersfriends.common.CommonProxyFm")
   public static CommonProxyFm proxy;  

 

goes into your mod class, not in the CommonProxy class.

 

You´re right, but I still get the same error.

Any other Ideas ?

Posted

I see that your render file is in the common package. Move it into the src / client package

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

I actually saw these lines in your mod file:

      
      RenderChopper renderChopper = new RenderChopper();


      ClientRegistry.registerTileEntity(TileEntityChopper.class, "TileEntityChopper", renderChopper);

 

This has to go into your ClientProxy, maybe into your registerRenderStuff() method.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

okay guys !

 

I figured out how to do it.

I had to add an

@SideOnly(Side.CLIENT);

at the top of the RenderChopper class, which I had to move to the src package.

The

RenderChopper render = new RenderChopper(); 

is not needed anymore. Now it works fine.

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

    • So, we have a 5 player server running the Hexxit modpack, with the sole addition of one extra mod, CustomNPCs. Something about CustomNPCs doesn't play nice with the server. Only three players are playing it, all of them have CustomNPCs installed in their own game files, and we have CustomNPCs installed in our server. We can all hold the tools and use the custom recipes added by the mod or by players using the NPC spawner tool. However, I'm the only one who can actually use them. If either other player uses them, they immediately crash and are booted off the server. I can make NPCs, the NPCs can detect them and attack them, all that, but they cannot see them, nor can they interact with them in any way. What could be causing this? I will add, as far as I know, I'm the only one to have run the modpack in single player as well as in multiplayer, I believe the other two have only run it in multiplayer for the server. Could this possibly be part of the problem? Any help would be appreciated.
    • Hello, Thank you so much for the suggestion, I will create a post.
    • You're using the wrong FACING property in Mechanism#getStateForPlacement, BlockStateProperties.FACING instead of Mechanism.FACING, HorizontalDirectionalBlock.FACING or BlockStateProperties.HORIZONTAL_FACING (which all refer to the same value). The former includes all six Direction values, the latter only includes the four horizontal values.
    • quiero que me digan como hago para instalar bien el java y forge nada mas hasta el momento lo hice pero java no ejecuta el forge   
    • Mod Idea: Server-Specific Mod Disabler & Anti-Cheat Helper Overview: This mod allows players to seamlessly play on Minecraft servers without worrying about banned or incompatible mods. It automatically disables specific mods based on the server's configuration, ensuring that players are only using allowed mods. Additionally, it provides a safeguard against hacking mods by instantly blocking them from being used, promoting fair gameplay on multiplayer servers. Key Features: 1. Server-Specific Mod Disabling: Automatic Mod Detection: The mod will automatically detect which mods are allowed or blocked on a particular server. Server Configurable Lists: Server admins can maintain a list of banned or whitelisted mods, which will be dynamically applied when a player joins. Player Customization: Players can choose whether the mod should automatically disable specific mods when joining servers, or allow them to be used based on the server's settings. 2. Anti-Cheat and Hack Protection: Instant Hack Detection: The mod will automatically identify and block known hacking mods when joining a server. If a player attempts to join with a hacking mod, the server can receive an alert, and the mod will prevent the player from joining until the mod is removed. Real-Time Monitoring: The mod will continuously monitor the player's mods while on the server, ensuring that no banned or suspicious mods are activated. 3. Community-Driven Mod Management: Custom Blocklists and Whitelists: Server admins can manage custom mod lists directly through a configuration file or via an in-game interface. These lists would allow mods to be either whitelisted, banned, or marked for temporary disabling. Integration with Modding Communities: The mod can gather mod compatibility reports from other players, sharing knowledge about which mods work together and which are problematic. 4. Player-Friendly Experience: Less Hassle for Players: With this mod, players no longer need to manually disable or enable mods when switching between servers. The mod takes care of everything for them. Seamless Gameplay: Players can freely switch between servers with different rules and mod requirements without worrying about compatibility issues or getting banned for using the wrong mods. 5. Open-Source and Extensible: Community Contributions: The mod will be open-source, allowing the Minecraft community to contribute by adding new features, bug fixes, and support for more mods. Customizable for Future Versions: The mod will be updated to support future Minecraft versions, ensuring long-term usability. Additional Ideas for Future Expansion: 1. Integration with Minecraft Servers (Optional): Server-Side Mod Configuration: In addition to client-side mod management, server owners can opt to install a server-side version of this mod, which can enforce mod restrictions for all players. Server Feedback System: When a mod is disabled, the server can automatically provide feedback to the player about why it was disabled and whether they need to install an alternative. 2. Donation and Support System: Monetization for Future Development: The mod could offer a donation-based system or a paid premium version with advanced features like real-time support or a larger mod compatibility database. Community Support: Players could report issues directly through the mod, ensuring faster resolutions and support from the mod development community. Benefits: 1. For Players: No Need for Constant Mod Configuration: Players no longer need to manually switch between different mod sets based on the server they join. Reduced Risk of Getting Banned: The mod automatically prevents the use of banned or incompatible mods, reducing the risk of being kicked or banned from servers. Hassle-Free Experience: The mod removes the need for players to learn about different server mod policies, providing a smoother experience overall. 2. For Server Owners: Simplified Server Management: Server admins no longer need to constantly monitor which mods players are using. The mod ensures players are only using compliant mods. Better Anti-Cheat Measures: Server owners can trust that hacking mods will be automatically blocked, improving server security. Easy Integration: With a simple configuration file, server owners can quickly set up their mod policies and get started. 3. For the Minecraft Community: Encourages Fair Play: The mod promotes fair gameplay by automatically preventing the use of cheating mods, ensuring a better multiplayer environment. Better Mod Compatibility: As the mod grows, it can help players and server owners discover which mods are compatible with others, making the modding ecosystem more reliable. Potential Challenges and Solutions: 1. Resistance from Players Using Hacking Mods: Solution: Allow server admins to configure a warning system where players can receive notifications about the mod being blocked before they are kicked. This gives them a chance to fix their setup. 2. Keeping Mod Lists Up-to-Date: Solution: Implement a community-driven reporting system where players and server owners can submit their mod lists, keeping the database current with new mods and changes in mod compatibility. 3. Cross-Platform Compatibility: Solution: Ensure that the mod is built to support both Java and Bedrock editions (if applicable) by using cross-platform modding tools and making the mod adaptable to both versions. Conclusion: This mod has the potential to significantly improve the Minecraft multiplayer experience by making it easier for players to manage mods and preventing hacks from ruining gameplay. By focusing on server-specific mod management and providing automated protection from cheating mods, this mod could change how Minecraft servers handle modding and create a safer, more enjoyable experience for everyone involved.
  • Topics

×
×
  • Create New...

Important Information

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