Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I tried to compile my mod, but it threw an Error. I don't know what is the problem.

 

The Error:

 

D:\-=Minecraft Modding=-\HouseStone Essentials\HouseStone-Essentials\HouseStone-Essentials\build\sources\java\com\sqbika\housestoneessentials\client\renderer\tileentity\TileEntityMentfRenderer.java:3: error: package assets.housestoneessentials.models does not e

xist

import assets.housestoneessentials.models.Mentf;

                                        ^

D:\-=Minecraft Modding=-\HouseStone Essentials\HouseStone-Essentials\HouseStone-Essentials\build\sources\java\com\sqbika\housestoneessentials\client\renderer\tileentity\TileEntityMentfRenderer.java:19: error: cannot find symbol

    private final Mentf model;

                  ^         

  symbol:  class Mentf     

  location: class TileEntityMentfRenderer

D:\-=Minecraft Modding=-\HouseStone Essentials\HouseStone-Essentials\HouseStone-Essentials\build\sources\java\com\sqbika\housestoneessentials\client\renderer\tileentity\TileEntityMentfRenderer.java:22: error: cannot find symbol

        this.model = new Mentf();

                        ^ 

  symbol:  class Mentf     

  location: class TileEntityMentfRenderer

Note: D:\-=Minecraft Modding=-\HouseStone Essentials\HouseStone-Essentials\HouseStone-Essentials\build\sources\java\com\sqbika\housestoneessentials\client\gui\ModGuiConfig.java uses unchecked or unsafe operations.

 

 

The Renderer Class:

 

package com.sqbika.housestoneessentials.client.renderer.tileentity;

 

import assets.housestoneessentials.models.Mentf;

import com.sqbika.housestoneessentials.reference.Reference;

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;

import org.lwjgl.opengl.GL11;

 

 

public class TileEntityMentfRenderer extends TileEntitySpecialRenderer {

 

    private final Mentf model;

 

    public TileEntityMentfRenderer() {

        this.model = new Mentf();

    }

 

    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();

    }

 

    @Override

    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("housestoneessentials:textures/blocks/mentf.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();

    }

 

    //Set the lighting stuff, so it changes it's brightness properly.

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

        Tessellator tess = Tessellator.instance;

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

        //As of MC 1.7+ block.getBlockBrightness() has become block.getLightValue():

        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);

    }

}

 

 

 

I need to register the model class? IDEA itself doesn't throw an exception when I try to run it, it works in IDEA.

Hi

 

At a guess it is because your upper/lower case don't match.  package names and their directories should match each other exactly.  By convention they should be in all lower case.

 

-TGG

  • Author

i checked it. Lower-Upper cases are correct. My prediction is that, the builder doesn't see the model file. I don't know why, but I think that is the problem.

 

Another strange this is, when I run MC in Idea, it doesn't give error...

  • Author

Okay. I solved it.

Solution:

I moved my Mentf.java (The model file) inside the the com.sqbika.blablabla, so that the builder can find it, cause it cannot find it previously.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.