Jump to content

[1.8.9] Rendering Custom Primed TNT (And custom Arrow)


Recommended Posts

Posted

I'm having trouble with rendering my PrimedTnt. I basically copied and edited the vanilla PrimedTnt class, but when I spawn the Entity, it's invisible (It still explodes though.)

 

Here is my Render Class:

package tschipp.bedrockium.entity.render;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BlockRendererDispatcher;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import tschipp.bedrockium.blocks.BedrockiumBlocks;
import tschipp.bedrockium.entity.EntityBedrockiumTNTPrimed;
import tschipp.bedrockium.entity.render.RenderBedrockiumGolem.Factory;

public class RenderBedrockiumTNTPrimed  extends Render<EntityBedrockiumTNTPrimed>
{



public RenderBedrockiumTNTPrimed(RenderManager renderManager) {
	super(renderManager);
	this.shadowSize = 0.5F;

}

@Override
public void doRender(EntityBedrockiumTNTPrimed entity, double x, double y, double z, float entityYaw, float partialTicks)
    {

        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.pushMatrix();
        GlStateManager.translate((float)x, (float)y + 0.5F, (float)z);

        if ((float)entity.fuse - partialTicks + 1.0F < 10.0F)
        {
            float f = 1.0F - ((float)entity.fuse - partialTicks + 1.0F) / 10.0F;
            f = MathHelper.clamp_float(f, 0.0F, 1.0F);
            f = f * f;
            f = f * f;
            float f1 = 1.0F + f * 0.3F;
            GlStateManager.scale(f1, f1, f1);
        }

        float f2 = (1.0F - ((float)entity.fuse - partialTicks + 1.0F) / 100.0F) * 0.8F;
        this.bindEntityTexture(entity);
        GlStateManager.translate(-0.5F, -0.5F, 0.5F);
        blockrendererdispatcher.renderBlockBrightness(BedrockiumBlocks.bedrockiumTnt.getDefaultState(), entity.getBrightness(partialTicks));
        GlStateManager.translate(0.0F, 0.0F, 1.0F);

        if (entity.fuse / 5 % 2 == 0)
        {
            GlStateManager.disableTexture2D();
            GlStateManager.disableLighting();
            GlStateManager.enableBlend();
            GlStateManager.blendFunc(770, 772);
            GlStateManager.color(1.0F, 1.0F, 1.0F, f2);
            GlStateManager.doPolygonOffset(-3.0F, -3.0F);
            GlStateManager.enablePolygonOffset();
            blockrendererdispatcher.renderBlockBrightness(BedrockiumBlocks.bedrockiumTnt.getDefaultState(), 1.0F);
            GlStateManager.doPolygonOffset(0.0F, 0.0F);
            GlStateManager.disablePolygonOffset();
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
            GlStateManager.disableBlend();
            GlStateManager.enableLighting();
            GlStateManager.enableTexture2D();
        }

        GlStateManager.popMatrix();
        super.doRender(entity, x, y, z, entityYaw, partialTicks);
    }

    /**
     * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
     */
@Override
    protected ResourceLocation getEntityTexture(EntityBedrockiumTNTPrimed entity)
    {
        return TextureMap.locationBlocksTexture;
    }






}

 

And my ClientProxy:

package tschipp.bedrockium.proxies;

import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import tschipp.bedrockium.blocks.BedrockiumBlockRendering;
import tschipp.bedrockium.entity.EntityBedrockiumGolem;
import tschipp.bedrockium.entity.EntityBedrockiumTNTPrimed;
import tschipp.bedrockium.entity.render.RenderBedrockiumGolem;
import tschipp.bedrockium.entity.render.RenderBedrockiumTNTPrimed;
import tschipp.bedrockium.items.BedrockiumItemRendering;

public class ClientProxy extends CommonProxy{



public void preInit(FMLPreInitializationEvent event) {

	super.preInit(event);
	RenderingRegistry.registerEntityRenderingHandler(EntityBedrockiumGolem.class, new RenderBedrockiumGolem.Factory());
	//Different Things that i've tried, none of them work

	RenderingRegistry.registerEntityRenderingHandler(EntityBedrockiumTNTPrimed.class, new RenderBedrockiumTNTPrimed(Minecraft.getMinecraft().getRenderManager()));

}

public void init(FMLInitializationEvent event) {

	super.init(event);

	BedrockiumItemRendering.registerItems();
	BedrockiumBlockRendering.registerBlocks();

	//Different Things that i've tried, none of them work
	Minecraft.getMinecraft().getRenderManager().entityRenderMap.put(EntityBedrockiumTNTPrimed.class, new RenderBedrockiumTNTPrimed(Minecraft.getMinecraft().getRenderManager()));
	RenderingRegistry.registerEntityRenderingHandler(EntityBedrockiumTNTPrimed.class, new RenderBedrockiumTNTPrimed(Minecraft.getMinecraft().getRenderManager()));

}

public void postInit(FMLPostInitializationEvent event) {

	super.postInit(event);

}


}

 

 

 

EDIT: I just did the same for a custom Arrow, it also doesn't get rendered in-game (Still works though). It appears that there seems to be a problem if the model is not in a separate model class.

 

Here is the RenderArrow:

package tschipp.bedrockium.entity.render;

import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import org.lwjgl.opengl.GL11;

import tschipp.bedrockium.entity.EntityBedrockiumArrow;
import tschipp.bedrockium.entity.EntityBedrockiumArrow;
import tschipp.bedrockium.entity.models.ModelBedrockiumGolem;
import tschipp.bedrockium.entity.render.RenderBedrockiumGolem.Factory;

@SideOnly(Side.CLIENT)
public class RenderBedrockiumArrow extends Render<EntityBedrockiumArrow>
{

public static final Factory FACTORY = new Factory();

private static final ResourceLocation arrowTextures = new ResourceLocation("be:textures/entity/arrow.png");

public RenderBedrockiumArrow(RenderManager renderManager)
{
	super(renderManager);
}

/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void func_76986_a(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityBedrockiumArrow entity, double x, double y, double z, float entityYaw, float partialTicks)
{
	this.bindEntityTexture(entity);
	GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
	GlStateManager.pushMatrix();
	GlStateManager.translate((float)x, (float)y, (float)z);
	GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks - 90.0F, 0.0F, 1.0F, 0.0F);
	GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, 0.0F, 0.0F, 1.0F);
	Tessellator tessellator = Tessellator.getInstance();
	WorldRenderer worldrenderer = tessellator.getWorldRenderer();
	int i = 0;
	float f = 0.0F;
	float f1 = 0.5F;
	float f2 = (float)(0 + i * 10) / 32.0F;
	float f3 = (float)(5 + i * 10) / 32.0F;
	float f4 = 0.0F;
	float f5 = 0.15625F;
	float f6 = (float)(5 + i * 10) / 32.0F;
	float f7 = (float)(10 + i * 10) / 32.0F;
	float f8 = 0.05625F;
	GlStateManager.enableRescaleNormal();
	float f9 = (float)entity.arrowShake - partialTicks;

	if (f9 > 0.0F)
	{
		float f10 = -MathHelper.sin(f9 * 3.0F) * f9;
		GlStateManager.rotate(f10, 0.0F, 0.0F, 1.0F);
	}

	GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F);
	GlStateManager.scale(f8, f8, f8);
	GlStateManager.translate(-4.0F, 0.0F, 0.0F);
	GL11.glNormal3f(f8, 0.0F, 0.0F);
	worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
	worldrenderer.pos(-7.0D, -2.0D, -2.0D).tex((double)f4, (double)f6).endVertex();
	worldrenderer.pos(-7.0D, -2.0D, 2.0D).tex((double)f5, (double)f6).endVertex();
	worldrenderer.pos(-7.0D, 2.0D, 2.0D).tex((double)f5, (double)f7).endVertex();
	worldrenderer.pos(-7.0D, 2.0D, -2.0D).tex((double)f4, (double)f7).endVertex();
	tessellator.draw();
	GL11.glNormal3f(-f8, 0.0F, 0.0F);
	worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
	worldrenderer.pos(-7.0D, 2.0D, -2.0D).tex((double)f4, (double)f6).endVertex();
	worldrenderer.pos(-7.0D, 2.0D, 2.0D).tex((double)f5, (double)f6).endVertex();
	worldrenderer.pos(-7.0D, -2.0D, 2.0D).tex((double)f5, (double)f7).endVertex();
	worldrenderer.pos(-7.0D, -2.0D, -2.0D).tex((double)f4, (double)f7).endVertex();
	tessellator.draw();

	for (int j = 0; j < 4; ++j)
	{
		GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
		GL11.glNormal3f(0.0F, 0.0F, f8);
		worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
		worldrenderer.pos(-8.0D, -2.0D, 0.0D).tex((double)f, (double)f2).endVertex();
		worldrenderer.pos(8.0D, -2.0D, 0.0D).tex((double)f1, (double)f2).endVertex();
		worldrenderer.pos(8.0D, 2.0D, 0.0D).tex((double)f1, (double)f3).endVertex();
		worldrenderer.pos(-8.0D, 2.0D, 0.0D).tex((double)f, (double)f3).endVertex();
		tessellator.draw();
	}

	GlStateManager.disableRescaleNormal();
	GlStateManager.popMatrix();
	super.doRender(entity, x, y, z, entityYaw, partialTicks);
}

/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityBedrockiumArrow entity)
{
	return arrowTextures;
}


public static class Factory implements IRenderFactory<EntityBedrockiumArrow>
{
	@Override
	public Render<? super EntityBedrockiumArrow> createRenderFor(RenderManager manager)
	{
		return new RenderBedrockiumArrow(manager);
	}
}
}

 

Posted

Like this? Still doesn't work.

 

ClientProxy:

package tschipp.bedrockium.proxies;

import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import tschipp.bedrockium.blocks.BedrockiumBlockRendering;
import tschipp.bedrockium.entity.EntityBedrockiumArrow;
import tschipp.bedrockium.entity.EntityBedrockiumBiter;
import tschipp.bedrockium.entity.EntityBedrockiumGolem;
import tschipp.bedrockium.entity.EntityBedrockiumTNTPrimed;
import tschipp.bedrockium.entity.render.RenderBedrockiumArrow;
import tschipp.bedrockium.entity.render.RenderBedrockiumBiter;
import tschipp.bedrockium.entity.render.RenderBedrockiumGolem;
import tschipp.bedrockium.entity.render.RenderBedrockiumTNTPrimed;
import tschipp.bedrockium.items.BedrockiumItemRendering;

public class ClientProxy extends CommonProxy{



public void preInit(FMLPreInitializationEvent event) {

	super.preInit(event);
	RenderingRegistry.registerEntityRenderingHandler(EntityBedrockiumGolem.class, new RenderBedrockiumGolem.Factory());
	RenderingRegistry.registerEntityRenderingHandler(EntityBedrockiumArrow.class, new RenderBedrockiumArrow.Factory());




}

public void init(FMLInitializationEvent event) {

	super.init(event);

	BedrockiumItemRendering.registerItems();
	BedrockiumBlockRendering.registerBlocks();


}

public void postInit(FMLPostInitializationEvent event) {

	super.postInit(event);

}


}

 

 

RenderBedrockiumTNT:

package tschipp.bedrockium.entity.render;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BlockRendererDispatcher;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.client.registry.IRenderFactory;
import tschipp.bedrockium.blocks.BedrockiumBlocks;
import tschipp.bedrockium.entity.EntityBedrockiumTNTPrimed;

public class RenderBedrockiumTNTPrimed  extends Render<EntityBedrockiumTNTPrimed>
{

public static final Factory FACTORY = new Factory();

public RenderBedrockiumTNTPrimed(RenderManager renderManager) {
	super(renderManager);
	this.shadowSize = 0.5F;

}

@Override
public void doRender(EntityBedrockiumTNTPrimed entity, double x, double y, double z, float entityYaw, float partialTicks)
    {

        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.pushMatrix();
        GlStateManager.translate((float)x, (float)y + 0.5F, (float)z);

        if ((float)entity.fuse - partialTicks + 1.0F < 10.0F)
        {
            float f = 1.0F - ((float)entity.fuse - partialTicks + 1.0F) / 10.0F;
            f = MathHelper.clamp_float(f, 0.0F, 1.0F);
            f = f * f;
            f = f * f;
            float f1 = 1.0F + f * 0.3F;
            GlStateManager.scale(f1, f1, f1);
        }

        float f2 = (1.0F - ((float)entity.fuse - partialTicks + 1.0F) / 100.0F) * 0.8F;
        this.bindEntityTexture(entity);
        GlStateManager.translate(-0.5F, -0.5F, 0.5F);
        blockrendererdispatcher.renderBlockBrightness(BedrockiumBlocks.bedrockiumTnt.getDefaultState(), entity.getBrightness(partialTicks));
        GlStateManager.translate(0.0F, 0.0F, 1.0F);

        if (entity.fuse / 5 % 2 == 0)
        {
            GlStateManager.disableTexture2D();
            GlStateManager.disableLighting();
            GlStateManager.enableBlend();
            GlStateManager.blendFunc(770, 772);
            GlStateManager.color(1.0F, 1.0F, 1.0F, f2);
            GlStateManager.doPolygonOffset(-3.0F, -3.0F);
            GlStateManager.enablePolygonOffset();
            blockrendererdispatcher.renderBlockBrightness(BedrockiumBlocks.bedrockiumTnt.getDefaultState(), 1.0F);
            GlStateManager.doPolygonOffset(0.0F, 0.0F);
            GlStateManager.disablePolygonOffset();
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
            GlStateManager.disableBlend();
            GlStateManager.enableLighting();
            GlStateManager.enableTexture2D();
        }

        GlStateManager.popMatrix();
        super.doRender(entity, x, y, z, entityYaw, partialTicks);
    }

    /**
     * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
     */
@Override
    protected ResourceLocation getEntityTexture(EntityBedrockiumTNTPrimed entity)
    {
        return TextureMap.locationBlocksTexture;
    }


public static class Factory implements IRenderFactory<EntityBedrockiumTNTPrimed>
{
	@Override
	public Render<? super EntityBedrockiumTNTPrimed> createRenderFor(RenderManager manager)
	{
		return new RenderBedrockiumTNTPrimed(manager);
	}
}






}

 

 

RenderBedrockiumArrow:

package tschipp.bedrockium.entity.render;

import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import org.lwjgl.opengl.GL11;

import tschipp.bedrockium.entity.EntityBedrockiumArrow;
import tschipp.bedrockium.entity.EntityBedrockiumArrow;
import tschipp.bedrockium.entity.models.ModelBedrockiumGolem;
import tschipp.bedrockium.entity.render.RenderBedrockiumGolem.Factory;

@SideOnly(Side.CLIENT)
public class RenderBedrockiumArrow extends Render<EntityBedrockiumArrow>
{

public static final Factory FACTORY = new Factory();

private static final ResourceLocation arrowTextures = new ResourceLocation("be:textures/entity/arrow.png");

public RenderBedrockiumArrow(RenderManager renderManager)
{
	super(renderManager);
}

/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void func_76986_a(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityBedrockiumArrow entity, double x, double y, double z, float entityYaw, float partialTicks)
{
	this.bindEntityTexture(entity);
	GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
	GlStateManager.pushMatrix();
	GlStateManager.translate((float)x, (float)y, (float)z);
	GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks - 90.0F, 0.0F, 1.0F, 0.0F);
	GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, 0.0F, 0.0F, 1.0F);
	Tessellator tessellator = Tessellator.getInstance();
	WorldRenderer worldrenderer = tessellator.getWorldRenderer();
	int i = 0;
	float f = 0.0F;
	float f1 = 0.5F;
	float f2 = (float)(0 + i * 10) / 32.0F;
	float f3 = (float)(5 + i * 10) / 32.0F;
	float f4 = 0.0F;
	float f5 = 0.15625F;
	float f6 = (float)(5 + i * 10) / 32.0F;
	float f7 = (float)(10 + i * 10) / 32.0F;
	float f8 = 0.05625F;
	GlStateManager.enableRescaleNormal();
	float f9 = (float)entity.arrowShake - partialTicks;

	if (f9 > 0.0F)
	{
		float f10 = -MathHelper.sin(f9 * 3.0F) * f9;
		GlStateManager.rotate(f10, 0.0F, 0.0F, 1.0F);
	}

	GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F);
	GlStateManager.scale(f8, f8, f8);
	GlStateManager.translate(-4.0F, 0.0F, 0.0F);
	GL11.glNormal3f(f8, 0.0F, 0.0F);
	worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
	worldrenderer.pos(-7.0D, -2.0D, -2.0D).tex((double)f4, (double)f6).endVertex();
	worldrenderer.pos(-7.0D, -2.0D, 2.0D).tex((double)f5, (double)f6).endVertex();
	worldrenderer.pos(-7.0D, 2.0D, 2.0D).tex((double)f5, (double)f7).endVertex();
	worldrenderer.pos(-7.0D, 2.0D, -2.0D).tex((double)f4, (double)f7).endVertex();
	tessellator.draw();
	GL11.glNormal3f(-f8, 0.0F, 0.0F);
	worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
	worldrenderer.pos(-7.0D, 2.0D, -2.0D).tex((double)f4, (double)f6).endVertex();
	worldrenderer.pos(-7.0D, 2.0D, 2.0D).tex((double)f5, (double)f6).endVertex();
	worldrenderer.pos(-7.0D, -2.0D, 2.0D).tex((double)f5, (double)f7).endVertex();
	worldrenderer.pos(-7.0D, -2.0D, -2.0D).tex((double)f4, (double)f7).endVertex();
	tessellator.draw();

	for (int j = 0; j < 4; ++j)
	{
		GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
		GL11.glNormal3f(0.0F, 0.0F, f8);
		worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
		worldrenderer.pos(-8.0D, -2.0D, 0.0D).tex((double)f, (double)f2).endVertex();
		worldrenderer.pos(8.0D, -2.0D, 0.0D).tex((double)f1, (double)f2).endVertex();
		worldrenderer.pos(8.0D, 2.0D, 0.0D).tex((double)f1, (double)f3).endVertex();
		worldrenderer.pos(-8.0D, 2.0D, 0.0D).tex((double)f, (double)f3).endVertex();
		tessellator.draw();
	}

	GlStateManager.disableRescaleNormal();
	GlStateManager.popMatrix();
	super.doRender(entity, x, y, z, entityYaw, partialTicks);
}

/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityBedrockiumArrow entity)
{
	return arrowTextures;
}


public static class Factory implements IRenderFactory<EntityBedrockiumArrow>
{
	@Override
	public Render<? super EntityBedrockiumArrow> createRenderFor(RenderManager manager)
	{
		return new RenderBedrockiumArrow(manager);
	}
}
}

Posted

I mean, it works for the Golem.

Here ist the Main Class:

 

package tschipp.bedrockium;


import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.EntityRegistry;
import tschipp.bedrockium.crafting.BedrockiumCrafting;
import tschipp.bedrockium.entity.EntityBedrockiumArrow;
import tschipp.bedrockium.entity.EntityBedrockiumBiter;
import tschipp.bedrockium.entity.EntityBedrockiumGolem;
import tschipp.bedrockium.entity.EntityBedrockiumTNTPrimed;
import tschipp.bedrockium.items.BedrockiumItems;
import tschipp.bedrockium.proxies.CommonProxy;

@Mod(modid = "be", name = "Bedrockium Mod", version = "1.0")

public class BedrockiumMod {

@Instance(value = "bedrockium")
public static BedrockiumMod instance;

public static final String CLIENT_PROXY = "tschipp.bedrockium.proxies.ClientProxy";
public static final String COMMON_PROXY = "tschipp.bedrockium.proxies.CommonProxy";


@SidedProxy(clientSide = CLIENT_PROXY, serverSide = COMMON_PROXY)
public static CommonProxy proxy;





@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	//Item/Block init and registering
	//Config handling
/*	ConfigHandler.config = new Configuration(event.getSuggestedConfigurationFile());
	ConfigHandler.syncConfig(); */
	proxy.preInit(event);

	EntityRegistry.registerModEntity(EntityBedrockiumGolem.class, "BedrockiumGolem", 1, this, 60, 1, true);
	EntityRegistry.registerModEntity(EntityBedrockiumTNTPrimed.class, "BedrockiumTNT", 2, this, 0, 1, true);
	EntityRegistry.registerModEntity(EntityBedrockiumArrow.class, "BedrockiumArrow", 3, this, 0, 1, true);
	EntityRegistry.registerModEntity(EntityBedrockiumBiter.class, "BedrockiumBiter", 4, this, 60, 1, true, 27421, 3881787);

}



@EventHandler
public void init(FMLInitializationEvent event) {
	//Proxy, TileEntity, entity, GUI and Packet Registering	
	//All the Crafting Recipes

	proxy.init(event);

	BedrockiumCrafting.craft();

}


@EventHandler
public void postInit(FMLPostInitializationEvent event) {
	proxy.postInit(event);

}

public static CreativeTabs bedrockium = new CreativeTabs("bedrockium"){
	@Override
	public Item getTabIconItem(){
		return new ItemStack(BedrockiumItems.bedrockiumIngot).getItem();
	}
};



}

Posted
EntityRegistry.registerModEntity(EntityBedrockiumTNTPrimed.class, "BedrockiumTNT", 2, this, 0, 1, true);

You have set the tracking range to 0, maybe that could be the issue?

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

You were right! I goofed, I thought it was the range that the mob could track you from, and since a Arrow or Tnt shouldn't be able to track you I set it to 0.

 

Well, it almost works now. The arrow gets rendered, but a second after it gets stuck in a block, it glitches out and gets teleported to a place where it was short before. This bug can also occur with normal arrows, but the effect ist way more extreme here.

 

The Tnt also just gets rendered for a split second, then dissapears.

 

Before getting teleported back:

9Zc6meC.png

 

 

After getting teleported:

q5biIjS.png

 

EDIT: Fixed the Arrow, still stuck on the Tnt though

 

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 i have a forge modded aternos server that worked just fine for a month untill today it suddenly crashes most of the time giving errors and idk which mod is causing the error or its smth else here is the crash log link https://mclo.gs/gGkzGKT
    • Struggling to decipher a crash report I'm getting in a custom modpack I'm tinkering with. The crash happens on startup, but weirdly, only some of the time. It seems to be related to Steves Carts, but weirdly it only started happening recently, and I can't identify if another mod is conflicting, or why it is only happening some of the time:   java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.player.Player.m_20202_()" because "player" is null at vswe.stevescarts.events.OverlayEventHandler.onRenderTick(OverlayEventHandler.java:24) ~[stevescarts-1.20.1-1.1.14.jar%23527!/:1.20.1-1.1.14] {re:classloading} at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:260) ~[eventbus-6.0.5.jar%23127!/:?] {} at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:252) ~[eventbus-6.0.5.jar%23127!/:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%23127!/:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%23127!/:?] {} at net.minecraftforge.event.ForgeEventFactory.onRenderTickEnd(ForgeEventFactory.java:919) ~[forge-1.20.1-47.1.106-universal.jar%23581!/:?] {re:mixin,re:classloading,pl:mixin:APP:modernfix-forge.mixins.json:perf.potential_spawns_alloc.ForgeEventFactoryMixin,pl:mixin:A} at net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1148) ~[client-1.20.1-20230612.114412-srg.jar%23576!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick_render_call,xf:fml:xaerominimap:xaero_minecraftclient,xf:fml:xaeroworldmap:xaero_wm_minecraftclient,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick_render_call,xf:fml:xaerominimap:xaero_minecraftclient,xf:fml:xaeroworldmap:xaero_wm_minecraftclient,pl:mixin:A,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:718) ~[client-1.20.1-20230612.114412-srg.jar%23576!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick_render_call,xf:fml:xaerominimap:xaero_minecraftclient,xf:fml:xaeroworldmap:xaero_wm_minecraftclient,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick_render_call,xf:fml:xaerominimap:xaero_minecraftclient,xf:fml:xaeroworldmap:xaero_wm_minecraftclient,pl:mixin:A,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:218) ~[minecraft-1.20.1-client.jar:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:flywheel.mixins.json:ClientMainMixin,pl:mixin:A,pl:runtimedistcleaner:A}     Including some extra info in case any of it is relevant^. Appreciate any ideas/advice!    
    • Try the JVM argument in this post, just sub xmx/xms numbers for what you want/need allocated.  https://www.reddit.com/r/feedthebeast/s/lzmKUNZFrG I'm having the same issue with a huge modpack using the 3 culprits to your issue.  Let me know if this helps!
    • i have been trying to  lauch a modpack and it crashes in the lauching phase   
    • nope, even the log is the exact same, i also tried with the Dimensional doors just in case and nothing.
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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