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

Hello Everyone i found a glitchy part on my custom tile block which i cant find out whats the problem with my code.

 

Apparently whenever i placed my block beside any vanilla blocks or any block aside from itself the block texture is become error or invinsible should i say.

 

Here's an example

 

xm3kALn.png

 

 

Any help? I setup my render correctly my block bounds fine.

 

RenderBlock

package mhfc.net.client.render.block;

import org.lwjgl.opengl.GL11;

import mhfc.net.client.model.block.ModelArmorStandBase;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;

public class RenderArmorStandBase extends TileEntitySpecialRenderer {

private ModelArmorStandBase model;
private static final ResourceLocation texture = new ResourceLocation("mhfc:textures/tile/armorstandbase.png");

public RenderArmorStandBase() {
	model = new ModelArmorStandBase();
}

public void renderTileEntityAt(TileEntity tileentity, double x, double y,double z, float f) {
	GL11.glPushMatrix();
	GL11.glTranslatef((float)x + 0.5F, (float)y - -1.5F, (float)z + 0.5F);
	GL11.glRotatef(180F, 0F, 0F, 1F);
	bindTexture(texture);
	GL11.glPushMatrix();
	model.renderModel(0.0625F);
	GL11.glPopMatrix();
	GL11.glPopMatrix();
}


}

 

 

BlockCode

package mhfc.net.client.block.container;

import mhfc.net.MHFCMain;
import mhfc.net.client.tile.TileArmorStandBase;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;

public class BlockArmorStandBase extends BlockContainer {

public BlockArmorStandBase() {
	super(Material.iron);
	setBlockBounds(1F/16F* -0.1f, 0, 1F/16F*-0.1f, 1F-1F/16F*-0.1f, 1F-1F/16F*12F, 1F-1F/16F*-0.1f);
	setBlockName("armorstandblock");
	setBlockTextureName("mhfc:armorstandblock");
	setHardness(1.3F);
	setCreativeTab(MHFCMain.mhfctabs);
}

public TileEntity createNewTileEntity(World var1, int var2) {
	return new TileArmorStandBase();
}


public int getRenderType(){
	return -1;
}

public void registerIcons(IIconRegister par1IconRegister){
	blockIcon = par1IconRegister.registerIcon("mhfc:armorstandblock");
}


}

  • Author

Nevermind i think i fixed it by adding this to the method isOpaqueCube :D

 

@Override //<---------- GGWP
public boolean isOpaqueCube(){
	return false;
}

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.