Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.7.10]Weird crash report And TE's not rendering properly [solved]


Alphafox_13
 Share

Recommended Posts

it happens randomly idk what causes it

 

java.lang.NullPointerException: Rendering Block Entity
at ships.addon.blocks_items.RenderMast.func_147500_a(RenderMast.java:29)
at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.func_147549_a(SourceFile:100)
at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.func_147544_a(SourceFile:92)
at net.minecraft.client.renderer.RenderGlobal.func_147589_a(RenderGlobal.java:483)
at net.minecraft.client.renderer.EntityRenderer.func_78471_a(EntityRenderer.java:1224)
at net.minecraft.client.renderer.EntityRenderer.func_78480_b(EntityRenderer.java:1015)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:989)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:887)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

Also it wont let me launch debug it just highlights this line of code

 

uMp6gJs.png

 

The  tileentities stop rendering when they think i cant see them?

95lwDwi.png

 

 

Here is my bitbucket:

https://bitbucket.org/AlphaFox/shipsaddon/src

 

and here is the compiled version download:

http://www.mediafire.com/download/h2quv5hqxfuq2ah/Sails.zip

 

And lastly here is the forum thread on MC forums if u want it:

http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/2384775-sails-masts-addon-for-ships-mod-90-complete

Link to comment
Share on other sites

Please Post the relevant code(TileEntity and TileEntitySpecialRenderer) here, the Bitbucket does not allow to see the code without login. (or is it private? Then we cannot help you)

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

sorry i am new to bitbucket and modding in general. It is now public

this is the TileEntitySpecialRenderer

package ships.addon.blocks_items;

import net.minecraft.block.Block;
import net.minecraft.block.BlockAnvil;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity;
import net.minecraft.world.IBlockAccess;
import ships.addon.blocks_items.BlockSail;

import org.lwjgl.opengl.GL11;

import ships.addon.lib.Ref;
import ships.addon.models.AcendingSailModel;
import ships.addon.models.MastModel;
import ships.addon.models.SailModel;

public class RenderSail extends TileEntitySpecialRenderer{

private static final ResourceLocation textureSail = new ResourceLocation(Ref.MODID+":"+"textures/blocks/sail.png");
private SailModel modelSail;
private AcendingSailModel acendingSail;

public RenderSail(){
	this.modelSail = new SailModel();
	this.acendingSail = new AcendingSailModel();
	}

@Override
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f){
GL11.glPushMatrix();
	GL11.glTranslatef((float)x+0.5F,(float)y-0.5F,(float)z+0.5F);
	this.bindTexture(textureSail);
	byte Direction = ((TEsail)tileentity.getWorldObj().getTileEntity(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord)).getValue();
	int dir = 0;
	dir = Direction;
	if(Direction>1&&Direction<=5){dir = Direction-2;}
	else if(Direction>5){dir = Direction-6;}
	GL11.glRotatef((float)dir*90, 0.0F, 1.0F, 0.0F);
	if(Direction>5){GL11.glTranslatef(0.5F,0.0F,0.0F);}
	if(Direction<=1){this.modelSail.renderModel(0.0625F);}
	else if(Direction>1){this.acendingSail.renderModel(0.0625F);}
GL11.glPopMatrix();
}
}

package ships.addon.blocks_items;

import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;

public class TEsail extends TileEntity {
private byte Direction;

//---- Setters and Getters ----\\
public byte getValue() {
    return Direction;
}
public void setValue(byte value) {
    Direction = value;
}

//---- Read and Write ----\\
    public void writeToNBT(NBTTagCompound nbt)
    {
    	nbt.setByte("Direction", this.Direction);
        super.writeToNBT(nbt);
        markForUpdate();
    }
    public void readFromNBT(NBTTagCompound nbt)
    {
    	this.Direction = nbt.getByte("Direction");
        super.readFromNBT(nbt);
    }
    
    //---- Packets ----\\
    @Override
    public Packet getDescriptionPacket(){
    	NBTTagCompound tileTag = new NBTTagCompound();
    	this.writeToNBT(tileTag);
    	return new S35PacketUpdateTileEntity(this.xCoord,this.yCoord,this.zCoord,0,tileTag);   	
    }
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt)
{
	this.readFromNBT(pkt.func_148857_g());
}

//---- Mark for Update ----\\
public void markForUpdate() {
    this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}

Link to comment
Share on other sites

Ok well i have solved half the problem 

//Shape1.mirror = true;

http://www.minecraftforge.net/forum/index.php/topic,29024.0.html

pointed me in the right direction. What is Shape1.mirror supposed to do anyway?

 

 

however i am still getting the disapearing TE problem http://prntscr.com/6mrtsl

whenever i tun my screen to far it seems to assume i cant see the block anymore then it hides it.

Link to comment
Share on other sites

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

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • report error: [16:09:34] [Server thread/WARN] [minecraft/EntityType]: Exception loading entity:  java.lang.NullPointerException: null     at net.minecraft.entity.ai.attributes.AttributeModifierManager.getAttributeValue(AttributeModifierManager.java:67) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.entity.LivingEntity.getAttributeValue(LivingEntity.java:1849) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.entity.LivingEntity.getMaxHealth(LivingEntity.java:1610) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.entity.LivingEntity.<init>(LivingEntity.java:209) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.entity.MobEntity.<init>(MobEntity.java:108) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.entity.CreatureEntity.<init>(CreatureEntity.java:13) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.entity.AgeableEntity.<init>(AgeableEntity.java:21) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.entity.passive.AnimalEntity.<init>(AnimalEntity.java:37) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.fsmc.classmates.animals.n7Yjy.<init>(n7Yjy.java:24) ~[main/:?] {re:classloading}     at net.minecraft.entity.EntityType.create(EntityType.java:448) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.entity.EntityType.lambda$loadEntityUnchecked$1(EntityType.java:459) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at java.util.Optional.map(Optional.java:215) ~[?:1.8.0_281] {}     at net.minecraft.entity.EntityType.loadEntityUnchecked(EntityType.java:458) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.entity.EntityType.loadEntity(EntityType.java:516) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.entity.EntityType.loadEntityAndExecute(EntityType.java:498) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.command.impl.SummonCommand.summonEntity(SummonCommand.java:50) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at net.minecraft.command.impl.SummonCommand.lambda$register$1(SummonCommand.java:34) ~[forge-1.16.5-36.2.20_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}     at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:262) ~[brigadier-1.0.17.jar:?] {re:classloading}     at net.minecraft.command.Commands.handleCommand(Commands.java:222) ~[forge:?] {re:classloading}     at net.minecraft.network.play.ServerPlayNetHandler.handleSlashCommand(ServerPlayNetHandler.java:1162) ~[forge:?] {re:classloading}     at net.minecraft.network.play.ServerPlayNetHandler.func_244548_c(ServerPlayNetHandler.java:1142) ~[forge:?] {re:classloading}     at net.minecraft.network.play.ServerPlayNetHandler.processChatMessage(ServerPlayNetHandler.java:1121) ~[forge:?] {re:classloading}     at net.minecraft.network.play.client.CChatMessagePacket.processPacket(CChatMessagePacket.java:40) ~[forge:?] {re:classloading}     at net.minecraft.network.play.client.CChatMessagePacket.processPacket(CChatMessagePacket.java:8) ~[forge:?] {re:classloading}     at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:19) ~[forge:?] {re:classloading}     at net.minecraft.util.concurrent.TickDelayedTask.run(TickDelayedTask.java:20) ~[forge:?] {re:classloading}     at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:139) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) ~[forge:?] {re:classloading}     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:759) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:159) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:109) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.MinecraftServer.driveOneInternal(MinecraftServer.java:742) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.MinecraftServer.driveOne(MinecraftServer.java:736) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.util.concurrent.ThreadTaskExecutor.driveUntil(ThreadTaskExecutor.java:122) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.MinecraftServer.runScheduledTasks(MinecraftServer.java:722) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:668) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:233) ~[forge:?] {re:classloading,pl:accesstransformer:B}     at java.lang.Thread.run(Thread.java:748) [?:1.8.0_281] {}
    • public class ManaOverlay extends Gui implements IIngameOverlay { private final Minecraft mc; private Font font = null; public int left_height = 39; public int right_height = 49; private RenderGameOverlayEvent eventParent; public static final ResourceLocation GUI_MANA_LOCATION = new ResourceLocation("textures/gui/icons.png"); private static final ManaOverlay INSTANCE = new ManaOverlay(Minecraft.getInstance()); public ManaOverlay(Minecraft p_93005_) { super(p_93005_); this.mc = Minecraft.getInstance(); this.font = mc.font; OverlayRegistry.registerOverlayTop("Mana ", (gui, mStack, partialTicks, screenWidth, screenHeight) -> { boolean isMounted = gui.minecraft.player.getVehicle() instanceof LivingEntity; if (!isMounted && !gui.minecraft.options.hideGui && gui.shouldDrawSurvivalElements()) { setupOverlayRenderState(true, false); renderMana(screenWidth, screenHeight, mStack); } }); } public void setupOverlayRenderState(boolean blend, boolean depthText) { setupOverlayRenderState(blend, depthText, GUI_MANA_LOCATION); } public void setupOverlayRenderState(boolean blend, boolean depthTest, @Nullable ResourceLocation texture) { if (blend) { RenderSystem.enableBlend(); RenderSystem.defaultBlendFunc(); } else { RenderSystem.disableBlend(); } if (depthTest) { RenderSystem.enableDepthTest(); } else { RenderSystem.disableDepthTest(); } if (texture != null) { RenderSystem.enableTexture(); bind(texture); } else { RenderSystem.disableTexture(); } RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.setShader(GameRenderer::getPositionTexShader); } public static void init() { MinecraftForge.EVENT_BUS.register(INSTANCE); } public void renderMana(int width, int height, PoseStack mStack) { minecraft.getProfiler().push("mana"); Player player = (Player)this.minecraft.getCameraEntity(); RenderSystem.enableBlend(); int left = width / 2 + 91; int top = height - right_height ; boolean unused = false;// Unused flag in vanilla, seems to be part of a 'fade out' mechanic FoodData stats = minecraft.player.getFoodData(); int level = stats.getFoodLevel(); for (int i = 0; i < 10; ++i) { int idx = i * 2 + 1; int x = left - i * 8 - 9; int y = top; int icon = 16; byte background = 0; if (minecraft.player.hasEffect(MobEffects.HUNGER)) { icon += 36; background = 13; } if (unused) background = 1; //Probably should be a += 1 but vanilla never uses this if (player.getFoodData().getSaturationLevel() <= 0.0F && tickCount % (level * 3 + 1) == 0) { y = top + (random.nextInt(3) - 1); } blit(mStack, x, y, 16 + background * 9, 27, 9, 9); if (idx < level) blit(mStack, x, y, icon + 36, 27, 9, 9); else if (idx == level) blit(mStack, x, y, icon + 45, 27, 9, 9); } RenderSystem.disableBlend(); minecraft.getProfiler().pop(); } @Override public void render(ForgeIngameGui gui, PoseStack pStack, float partialTicks, int width, int height) { this.screenWidth = this.minecraft.getWindow().getGuiScaledWidth(); this.screenHeight = this.minecraft.getWindow().getGuiScaledHeight(); eventParent = new RenderGameOverlayEvent(pStack, partialTicks, this.minecraft.getWindow()); if (pre(ALL, pStack)) return; font = minecraft.font; this.random.setSeed(tickCount * 312871L); OverlayRegistry.orderedEntries().forEach(entry -> { try { if (!entry.isEnabled()) return; IIngameOverlay overlay = entry.getOverlay(); if (pre(overlay, pStack)) return; //overlay.render(this, pStack, partialTicks, screenWidth, screenHeight); post(overlay, pStack); } catch(Exception e) { } }); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); post(ALL, pStack); } private boolean pre(RenderGameOverlayEvent.ElementType type, PoseStack mStack) { return MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Pre(mStack, eventParent, type)); } private void post(RenderGameOverlayEvent.ElementType type, PoseStack mStack) { MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Post(mStack, eventParent, type)); } private boolean pre(IIngameOverlay overlay, PoseStack mStack) { return MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.PreLayer(mStack, eventParent, overlay)); } private void post(IIngameOverlay overlay, PoseStack mStack) { MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.PostLayer(mStack, eventParent, overlay)); } private void bind(ResourceLocation res) { RenderSystem.setShaderTexture(0, res); } } Thanks to you, I was able to display it. However, the bar that uses the full stomach ground keeps shaking. I wonder why that is? Then I feel like it's getting heavier ...
    • It's the "Width on the screen" and "Height on the screen", so in this case the screen width and height.
    • I was able to post the 4 others, so they are on there now.
    • Could be "write", check vanilla for examples, or provide details of which version you're currently on.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.