Jump to content

Recommended Posts

Posted

I am getting an error when using block model at ClientProxy.registerRenderThings();

 

Crash Report

 

---- Minecraft Crash Report ----

// But it works on my machine.

 

Time: 7/13/15 9:46 PM

Description: There was a severe problem during mod loading that has caused the game to fail

 

cpw.mods.fml.common.LoaderException: java.lang.ClassNotFoundException: com.soultechnamei.alchemicreachions.ClientProxy

at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:76)

at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:512)

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.EventSubscriber.handleEvent(EventSubscriber.java:74)

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)

at com.google.common.eventbus.EventBus.post(EventBus.java:275)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190)

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.EventSubscriber.handleEvent(EventSubscriber.java:74)

at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)

at com.google.common.eventbus.EventBus.post(EventBus.java:275)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)

at cpw.mods.fml.common.Loader.loadMods(Loader.java:513)

at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:208)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:522)

at net.minecraft.client.Minecraft.run(Minecraft.java:942)

at net.minecraft.client.main.Main.main(Main.java:164)

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 net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

at GradleStart.main(Unknown Source)

Caused by: java.lang.ClassNotFoundException: com.soultechnamei.alchemicreachions.ClientProxy

at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at cpw.mods.fml.common.ModClassLoader.loadClass(ModClassLoader.java:58)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Unknown Source)

at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:59)

... 35 more

Caused by: java.lang.NullPointerException

at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182)

... 41 more

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- System Details --

Details:

Minecraft Version: 1.7.10

Operating System: Windows 7 (amd64) version 6.1

Java Version: 1.7.0_79, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 308576480 bytes (294 MB) / 519438336 bytes (495 MB) up to 1056309248 bytes (1007 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms512M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1448 4 mods loaded, 4 mods active

States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

UC mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)

UC FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1448-1.7.10.jar)

UC Forge{10.13.4.1448} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1448-1.7.10.jar)

UE Alchemic Reactions{1.0} [Alchemic Reactions] (bin)

GL info: ' Vendor: 'Intel' Version: '2.1.0 - Build 8.15.10.2413' Renderer: 'Intel® B43 Express Chipset'

 

ClientProxy

 

package com.soultechnamei.alchemicreactions;

 

import com.soultechnamei.alchemicreactions.entity.BBACEntity;

import com.soultechnamei.alchemicreactions.entity.render.BBACEntityRender;

 

import cpw.mods.fml.client.registry.ClientRegistry;

 

public class ClientProxy extends CommonProxy {

 

public void registerRenderThings() {

        ClientRegistry.bindTileEntitySpecialRenderer(BBACEntity.class, new BBACEntityRender());

}

 

}

 

 

BBACEntityRender

 

package com.soultechnamei.alchemicreactions.entity.render;

 

import org.lwjgl.opengl.GL11;

 

import com.soultechnamei.alchemicreactions.entity.Model.BBACEntityModel;

 

import net.minecraft.block.Block;

import net.minecraft.client.Minecraft;

import net.minecraft.client.renderer.OpenGlHelper;

import net.minecraft.client.renderer.Tessellator;

import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;

import net.minecraft.entity.Entity;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.util.ResourceLocation;

import net.minecraft.world.World;

 

public class BBACEntityRender extends TileEntitySpecialRenderer  {

private final BBACEntityModel model;

 

public BBACEntityRender() {

this.model = new BBACEntityModel();

}

 

private void adjustRotatePivotViaMeta(World world, int x, int y, int z) {

int meta = world.getBlockMetadata(x, y, z);

GL11.glPushMatrix();

GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F);

GL11.glPopMatrix();

}

 

public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) {

 

GL11.glPushMatrix();

GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);

ResourceLocation textures = (new ResourceLocation("[yourmodidhere]:textures/blocks/TrafficLightPoleRed.png"));

Minecraft.getMinecraft().renderEngine.bindTexture(textures);

GL11.glPushMatrix();

GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);

this.model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

GL11.glPopMatrix();

GL11.glPopMatrix();

}

 

private void adjustLightFixture(World world, int i, int j, int k, Block block) {

Tessellator tess = Tessellator.instance;

float brightness = block.getLightValue(world, i, j, k);

int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0);

int modulousModifier = skyLight % 65536;

int divModifier = skyLight / 65536;

tess.setColorOpaque_F(brightness, brightness, brightness);

OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) modulousModifier, divModifier);

}

 

}

 

Main Mod File

 

package com.soultechnamei.alchemicreactions;

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.init.Blocks;

import net.minecraft.item.Item;

import net.minecraft.world.World;

import net.minecraftforge.common.MinecraftForge;

 

import com.soultechnamei.alchemicreactions.blocks.BBAC;

import com.soultechnamei.alchemicreactions.entity.BBACEntity;

import com.soultechnamei.alchemicreactions.items.ItemBAC;

import com.soultechnamei.alchemicreactions.items.ItemBEG;

import com.soultechnamei.alchemicreactions.ModEventHandler;

 

import cpw.mods.fml.common.FMLCommonHandler;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.EventHandler;

import cpw.mods.fml.common.SidedProxy;

import cpw.mods.fml.common.event.FMLInitializationEvent;

import cpw.mods.fml.common.event.FMLPreInitializationEvent;

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

 

@Mod(modid = ReactionsMain.MODID, version = ReactionsMain.VERSION)

public class ReactionsMain {

public static final String MODID = "Alchemic Reactions";

public static final String VERSION = "1.0";

 

public static Item BAC; // Basic Alchemy Circle

public static Item BEG;

 

public static Block BBAC;

 

 

ModEventHandler e = new ModEventHandler();

   

@SidedProxy(clientSide="com.soultechnamei.alchemicreachions.ClientProxy", serverSide="com.soultechnamei.alchemicreachionstions.CommonProxy")

public static CommonProxy proxy;

 

@EventHandler

public void preinit(FMLPreInitializationEvent event) {

       

FMLCommonHandler.instance().bus().register(e);

        MinecraftForge.EVENT_BUS.register(e);

 

 

// Blocks

BBAC = new BBAC(Material.rock).setHardness(1.5F).setStepSound(Block.soundTypeStone).setBlockName("BBAC")

.setCreativeTab(CreativeTabs.tabBlock);

// Items

BAC = new ItemBAC();

        BEG = new ItemBEG();

// Game Registry

GameRegistry.registerItem(BAC, "Basic Alchemy Circle");

      GameRegistry.registerItem(BEG, "Basic Essence Gem");

     

GameRegistry.registerBlock(BBAC, "BBAC");

 

ClientProxy.registerRenderThings();

GameRegistry.registerTileEntity(BBACEntity.class, "tileEntityTrafficLight");

 

}

}

 

 

BBAC (OUR BLOCK)

 

package com.soultechnamei.alchemicreactions.blocks;

 

import net.minecraft.block.Block;

import net.minecraft.block.BlockContainer;

import net.minecraft.block.material.Material;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.init.Blocks;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.world.World;

 

import com.soultechnamei.alchemicreactions.ModEventHandler;

import com.soultechnamei.alchemicreactions.entity.BBACEntity;

 

public class BBAC extends BlockContainer  {

 

public BBAC(Material material) {

super(material);

 

}

 

public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int i, float f, float g,

float t) {

if (!world.isRemote) {

Block B = world.getBlock(x, y - 1, z);

if (B == Blocks.grass) {

world.setBlock(x, y - 1, z, Blocks.sand);

} else if (B == Blocks.dirt) {

world.setBlock(x, y - 1, z, Blocks.sand);

} else {

 

}

 

} else {

 

}

return true;

}

 

@Override

public int getRenderType() {

return -1;

}

 

@Override

public boolean isOpaqueCube() {

return false;

}

 

public boolean renderAsNormalBlock() {

return false;

}

 

@Override

public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {

 

return new BBACEntity();

}

 

}

 

 

Model

 

 

package com.soultechnamei.alchemicreactions.entity.Model;

 

import net.minecraft.client.model.ModelBase;

import net.minecraft.client.model.ModelRenderer;

import net.minecraft.entity.Entity;

 

public class BBACEntityModel extends ModelBase {

// fields

ModelRenderer Shape1;

 

public BBACEntityModel() {

textureWidth = 32;

textureHeight = 32;

 

Shape1 = new ModelRenderer(this, 0, 0);

Shape1.addBox(0F, 0F, 0F, 16, 0, 16);

Shape1.setRotationPoint(-8F, 23.95F, -8F);

Shape1.setTextureSize(32, 32);

Shape1.mirror = true;

setRotation(Shape1, 0F, 0F, 0F);

}

 

public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {

super.render(entity, f, f1, f2, f3, f4, f5);

setRotationAngles(f, f1, f2, f3, f4, f5, entity);

Shape1.render(f5);

}

 

private void setRotation(ModelRenderer model, float x, float y, float z) {

model.rotateAngleX = x;

model.rotateAngleY = y;

model.rotateAngleZ = z;

}

 

public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) {

super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);

}

 

}

 

 

 

Any Ideas?

Posted

It can't find your proxy class:

java.lang.ClassNotFoundException: com.soultechnamei.alchemicreachions.ClientProxy

// but your ClientProxy is here:
package com.soultechnamei.alchemicreactions;

// your CommonProxy is even more garbled:
com.soultechnamei.alchemicreachionstions.CommonProxy

So, should it be 'reactions', or 'reachions'? :P

Posted

Though once fixed the error in the code did not leave. The "ClientProxy.registerRenderThings(); " is giving Cannot make a static reference to the non-static method registerRenderThings() from the type ClientProxy

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

    • I know that this may be a basic question, but I am very new to modding. I am trying to have it so that I can create modified Vanilla loot tables that use a custom enchantment as a condition (i.e. enchantment present = item). However, I am having trouble trying to implement this; the LootItemRandomChanceWithEnchantedBonusCondition constructor needs a Holder<Enchantment> and I am unable to use the getOrThrow() method on the custom enchantment declared in my mod's enchantments class. Here is what I have so far in the GLM:   protected void start(HolderLookup.Provider registries) { HolderLookup.RegistryLookup<Enchantment> registrylookup = registries.lookupOrThrow(Registries.ENCHANTMENT); LootItemRandomChanceWithEnchantedBonusCondition lootItemRandomChanceWithEnchantedBonusCondition = new LootItemRandomChanceWithEnchantedBonusCondition(0.0f, LevelBasedValue.perLevel(0.07f), registrylookup.getOrThrow(*enchantment here*)); this.add("nebu_from_deepslate", new AddItemModifier(new LootItemCondition[]{ LootItemBlockStatePropertyCondition.hasBlockStateProperties(Blocks.DEEPSLATE).build(), LootItemRandomChanceCondition.randomChance(0.25f).build(), lootItemRandomChanceWithEnchantedBonusCondition }, OrichalcumItems.NEBU.get())); }   Inserting Enchantments.[vanilla enchantment here] actually works but trying to declare an enchantment from my custom enchantments class as [mod enchantment class].[custom enchantment] does not work even though they are both a ResourceKey and are registered in Registries.ENCHANTMENT. Basically, how would I go about making it so that a custom enchantment declared as a ResourceKey<Enchantment> of value ResourceKey.create(Registries.ENCHANTMENT, ResourceLocation.fromNamespaceAndPath([modid], [name])), declared in a seperate enchantments class, can be used in the LootItemRandomChanceWithEnchantedBonusCondition constructor as a Holder? I can't use getOrThrow() because there is no level or block entity/entity in the start() method and it is running as datagen. It's driving me nuts.
    • Hi here is an update. I was able to fix the code so my mod does not crash Minecraft. Please understand that I am new to modding but I honestly am having a hard time understanding how anyone can get this to work without having extensive programming and debugging experience as well as searching across the Internet, multiple gen AI bots (claude, grok, openai), and examining source code hidden in the gradle directory and in various github repositories. I guess I am wrong because clearly there are thousands of mods so maybe I am just a newbie. Ok, rant over, here is a step by step summary so others can save the 3 days it took me to figure this out.   1. First, I am using forge 54.1.0 and Minecraft 1.21.4 2. I am creating a mod to add a shotgun to Minecraft 3. After creating the mod and compiling it, I installed the .jar file to the proper directory in Minecraft and used 1.21.4-forge-54.1.0 4. The mod immediately crashed with the error: Caused by: java.lang.NullPointerException: Item id not set 5. Using the stack trace, I determined that the Exception was being thrown from the net.minecraft.world.item.Item.Properties class 6. It seems that there are no javadocs for this class, so I used IntelliJ which was able to provide a decompiled version of the class, which I then examined to see the source of the error. Side question: Are there javadocs? 7. This method, specifically, was the culprit: protected String effectiveDescriptionId() {      return this.descriptionId.get(Objects.requireNonNull(this.id, "Item id not set"));  } 8. Now my quest was to determine how to set this.id. Looking at the same source file, I determined there was another method:  public Item.Properties setId(ResourceKey<Item> pId) {             this.id = pId;             return this;   } 9. So now, I need to figure out how to call setId(). This required working backwards a bit. Starting from the constructor, I stubbed out the variable p which is of type Item.Properties public static final RegistryObject<Item> SHOTGUN = ITEMS.register("shotgun", () -> new ShotgunItem(p)); Rather than putting this all on one line, I split it up for readability like this: private static final Item.Properties p = new Item.Properties().useItemDescriptionPrefix().setId(rk); Here is was the missing function, setId(), which takes a type of ResourceKey<Item>. My next problem is that due to the apparent lack of documentation (I tried searching the docs on this site) I could not determine the full import path to ResourceKey. I did some random searching on the Internet and stumbled across a Github repository which gave two clues: import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; Then I created the rk variable like this: private static ResourceKey<Item> rk = ResourceKey.create(Registries.ITEM, ResourceLocation.parse("modid:shotgunmod")); And now putting it all together in order: private static ResourceKey<Item> rk = ResourceKey.create(Registries.ITEM, ResourceLocation.parse("modid:shotgunmod")); private static final Item.Properties p = new Item.Properties().useItemDescriptionPrefix().setId(rk); public static final RegistryObject<Item> SHOTGUN = ITEMS.register("shotgun", () -> new ShotgunItem(p)); This compiled and the mod no longer crashes. I still have more to do on it, but hopefully this will save someone hours. I welcome any feedback and if I missed some obvious modding resource or tutorial that has this information. If not, I might suggest we add it somewhere for people trying to write a mod that doesn't crash. Thank you !!!  
    • I will keep adding to this thread with more information in case anyone can help, or at the very least I can keep my troubleshooting organized. I decided to downgrade to 54.1.0 in the hopes that this would fix the issue but it didn't. At least now I am on a "recommended" version. The crash report did confirm my earlier post that the Exception is coming from effectiveDescriptionId(). I'll continue to see if I can find a way to set the ID manually.   Caused by: java.lang.NullPointerException: Item id not set         at java.base/java.util.Objects.requireNonNull(Objects.java:259) ~[?:?]         at TRANSFORMER/[email protected]/net.minecraft.world.item.Item$Properties.effectiveDescriptionId(Item.java:465) ~[forge-1.21.4-54.1.0-client.jar!/:?]         at TRANSFORMER/[email protected]/net.minecraft.world.item.Item.<init>(Item.java:111) ~[forge-1.21.4-54.1.0-client.jar!/:?]         at TRANSFORMER/[email protected]/com.example.shotgunmod.ShotgunItem.<init>(ShotgunItem.java:19) ~[shotgunmod-1.0.0.jar!/:1.0.0]         at TRANSFORMER/[email protected]/com.example.shotgunmod.ModItems.lambda$static$0(ModItems.java:15) ~[shotgunmod-1.0.0.jar!/:1.0.0]         at TRANSFORMER/[email protected]/net.minecraftforge.registries.DeferredRegister$EventDispatcher.lambda$handleEvent      
    • It just randomly stop working after a rebooted my dedicated server PLEASE HELP!   com.google.gson   Failed to start the minecraft server com.google.gson.JsonSyntaxException: Expected a com.google.gson.JsonObject but was com.google.gson.JsonPrimitive; at path $  
  • Topics

×
×
  • Create New...

Important Information

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