Jump to content

Recommended Posts

Posted

I have a block with a custom model, and when I hit the block the particles are purple and black checkers.  The texture renders just fine on my block.  I saw the methods addBlockHitEffects and addBlockBreakEffects, do those control the texture?  Also, I saw in my console it says:

2013-08-08 17:33:00 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/blocks/MISSING_ICON_TILE_3921_null.png

which leads me into my second topic: I get this error message:

2013-08-08 17:33:01 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: civil war:textures/items/*item name*.png

This error prints even though my textures load just fine.  Does anybody know how to fix either or both of these problems?  Thanks

 

Ninjapancakes87

Posted

The first error message comes from func_111023_E() in Block. Make sure that field_111026_f isn't null.

The second comes from you initializing your block too soon.

 

Posted

The first error message comes from func_111023_E() in Block. Make sure that field_111026_f isn't null.

The second comes from you initializing your block too soon.

I called func111022_d to set field_111026_f, and that fixed that error message.  As for initializing my block too soon, I thought with the new @EventHandler notation you were supposed to initialize blocks and items in your PreInit stage (or so the javadocs say)

Posted

Do you use a TileEntityRenderer or a BlockRenderer  ?

Did you change some methods regarding rendering and icons in your block class ?

Yes I have a TileEntityRenderer and a BlockRenderer.  In my TileEntityRenderer is my code for rendering the block, and in the BlockRenderer is for rendering the block as 3D in my inventory, in my hand, on the ground, etc.  Does the model being 3D affect that?

Posted

Usually you only use one of them. Can you post both code ?

TileEntityRenderer:

package ninjapancakes87.civilwar.block.cannon;

import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import ninjapancakes87.civilwar.Extras;

import org.lwjgl.opengl.GL11;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class TileEntityCannonRenderer extends TileEntitySpecialRenderer {
private static final ResourceLocation texture = new ResourceLocation(Extras.sb + "cannon.png");
    /** The cannon model */
    private Cannon model;
    
    /** Instance of renderManager, super one is not visible*/
    protected RenderManager renderManager;

    public TileEntityCannonRenderer()
    {
    	this.model = new Cannon();
    }
    /**
     * Used for rendering the tile entity
     * @param tileentity is the tile entity you are using
     * @param d0 used for translation on the X axis
     * @param d1 used for translation on the Y axis
     * @param d2 used for translation on the Z axis
     * @param f is not used for anything (at least in mine).
     */
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) {
	TileEntityCannon cannonTE = (TileEntityCannon)tileentity;
	GL11.glPushMatrix();
	GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
	GL11.glScalef(1.0F, -1F, -1F);
	short scale = getScale(cannonTE.getRotation());
        GL11.glRotatef(scale, 0.0F, 1.0F, 0.0F);
	GL11.glRotatef(90, 0, 1.0F, 0);
	this.func_110628_a(texture);
	this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
	GL11.glPopMatrix(); 
}
public short getScale(byte rotation){
	short scale = 0;
	if(rotation == 2){
            scale = 0;
        }

        if(rotation == 3){
            scale = 180;
        }

        if(rotation == 4){
            scale = -90;
        }

        if(rotation == 5){
            scale = 90;
        }
        return scale;
}
public void rotate(short scale){
	GL11.glPushMatrix();
	GL11.glRotatef(scale, 0, 1, 0);
	GL11.glRotatef(90, 0, 1.0F, 0);
	GL11.glPopMatrix();
}

}

CannonRender:

package ninjapancakes87.civilwar.block.cannon;

import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import ninjapancakes87.civilwar.Extras;

import org.lwjgl.opengl.GL11;

import cpw.mods.fml.client.FMLClientHandler;

//@SideOnly(Side.CLIENT)
public class CannonRender implements IItemRenderer {

private static final ResourceLocation texture = new ResourceLocation(Extras.sb + "cannon.png");

protected RenderManager renderManager;

    private Cannon model;

    public CannonRender() {

        model = new Cannon();
    }

    @Override
    public boolean handleRenderType(ItemStack item, ItemRenderType type) {

        return true;
    }

    @Override
    public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {

        return true;
    }

    @Override
    public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    	switch (type) {
            case ENTITY: {
                renderCannon(-0.5F, 0.0F, 0.5F, 0.25F, 0F, 0F, 0F, 0F, 0);
                return;
            }
            case EQUIPPED: {
                renderCannon(1.0F, 5.1F, 3.0F, 0.25F, 180F, 0F, 0F, 0F, 0);
                return;
            }
            case EQUIPPED_FIRST_PERSON: {
                renderCannon(0.0F, 6.0F, 0.0F, 0.25F, -90F, -110F, 0F, 90F, 1);
                return;
            }
            case INVENTORY: {
                renderCannon(-1.0F, 2.2F, -0.1F, 0.23F, 180F, 0F, 0F, 0F, 0);
                return;
            }
            default:
                return;
        }
    }

    private void renderCannon(float x, float y, float z, float scale, float rotate, float r1, float r2, float r3, float a) {

        GL11.glPushMatrix();
        GL11.glDisable(GL11.GL_LIGHTING);

        // Scale, Translate, Rotate
        GL11.glScalef(scale, scale, scale);
        GL11.glTranslatef(x, y, z);
        GL11.glRotatef(rotate, r1, r2, r3);
        if( a == 1){
        	GL11.glRotatef(rotate, r1, r2, r3);
        }

        // Bind texture
        //this.renderManager.renderEngine.func_110577_a(texture);
        FMLClientHandler.instance().getClient().renderEngine.func_110577_a(texture);

        // Render
        
        model.render((Entity)null,0.0F, 0.0F, 0.0F, 0.0F, 0.0F, scale);

        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glPopMatrix();
    }

}

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 also just tried with iron's spellbooks removed, since that seemed related, but i am still having the same problem, even in newly created worlds. https://mclo.gs/AtrAfaj 
    • My Gradle Project for my Minecraft mod isn't building. Terminal: * Where: Settings file 'C:\Users\csonn\OneDrive\Desktop\fusionlucky\settings.gradle' line: 2 * What went wrong: Could not compile settings file 'C:\Users\csonn\OneDrive\Desktop\fusionlucky\settings.gradle'. > startup failed:   settings file 'C:\Users\csonn\OneDrive\Desktop\fusionlucky\settings.gradle': 2: The pluginManagement {} block must appear before any other statements in the script.   For more information on the pluginManagement {} block, please refer to https://docs.gradle.org/9.0.0/userguide/plugins.html#sec:plugin_management in the Gradle documentation.    @ line 2, column 1.      pluginManagement {      ^   1 error * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to generate a Build Scan (Powered by Develocity). > Get more help at https://help.gradle.org.   Setting.Gradle File:   rootProject.name = 'fusion-lucky-block' pluginManagement {     repositories {         gradlePluginPortal()         maven { url "https://maven.minecraftforge.net/" }         mavenCentral()     } }
    • no change still. here's a new log  https://mclo.gs/RXwiZmn 
    • Whenever I go to build my it says "Build failed in " how many seconds   Here is what is said in my terminal * Where: Build file 'C:\Users\csonn\OneDrive\Desktop\fusionlucky\build.gradle' line: 3 * What went wrong: Plugin [id: 'net.minecraftforge.gradle', version: '6.1.51'] was not found in any of the following sources: - Gradle Core Plugins (plugin is not in 'org.gradle' namespace) - Included Builds (No included builds contain this plugin) - Plugin Repositories (could not resolve plugin artifact 'net.minecraftforge.gradle:net.minecraftforge.gradle.gradle.plugin:6.1.51')   Searched in the following repositories:     Gradle Central Plugin Repository     MinecraftForge(https://maven.minecraftforge.net/) * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Get more help at https://help.gradle.org.   Here is what is in my build.gradle file plugins {     id 'java'     id 'net.minecraftforge.gradle' version '6.1+' }   group = 'io.github.csonnic03.fusionlucky' version = '1.0.0' archivesBaseName = 'fusionlucky'   java {     toolchain {         languageVersion = JavaLanguageVersion.of(17)     } }   repositories {     mavenCentral()     maven {         name "forgeMaven"         url "https://maven.minecraftforge.net/<repository>" } }   dependencies {     minecraft 'net.minecraftforge:forge:1.20.1-47.1.0' }   minecraft {     mappings channel: 'official', version: '1.20.1'     runs {         client {             workingDirectory project.file('run')         }         server {             workingDirectory project.file('run')         }     } }   tasks.withType(JavaCompile) {     options.encoding = 'UTF-8' }   jar {     manifest {         attributes(             "Specification-Title": "Fusion Lucky Block",             "Specification-Vendor": "example",             "Implementation-Title": project.name,             "Implementation-Version": project.version,             "Implementation-Vendor": "example",             "ModLauncher-TargetFMLVersion": "[47,)"         )     } }  
  • Topics

×
×
  • Create New...

Important Information

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