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 think ill have to use EntityAdditionalspawndate fore thevehicleloading before entities are rendered, but still i can't render them out - why? here is my renderer:

 

 

package itsamysterious.mods.reallifemod.core.rendering.Entities;

 

import java.util.HashMap;

import java.util.Map;

 

import org.lwjgl.opengl.GL11;

 

import itsamysterious.mods.reallifemod.client.forgeobjmodelported.AdvancedModelLoader;

import itsamysterious.mods.reallifemod.client.forgeobjmodelported.IModelCustom;

import itsamysterious.mods.reallifemod.core.vehicles.EntityVehicle;

import itsamysterious.mods.reallifemod.core.vehicles.VehicleFile;

import itsamysterious.mods.reallifemod.init.Reference;

import net.minecraft.client.Minecraft;

import net.minecraft.client.renderer.entity.Render;

import net.minecraft.client.renderer.entity.RenderManager;

import net.minecraft.entity.Entity;

import net.minecraft.util.ResourceLocation;

 

public class RenderVehicle extends Render{

private Class<?extends EntityVehicle> entityClass;

private static Map <String,IModelCustom> models = new HashMap<String, IModelCustom>();

private static Map <String,ResourceLocation> textures = new HashMap<String, ResourceLocation>();

VehicleFile f = null;

 

public RenderVehicle(RenderManager renderManager) {

super(renderManager);

shadowSize=1;

}

 

public void doRender(Entity entity, double x, double y, double z, float p_76986_8_, float partialTicks) {

if(entity.getClass().isInstance(EntityVehicle.class)){

renderVehicle((EntityVehicle)entity, x, y, z, p_76986_8_, partialTicks);

}

};

 

private void renderVehicle(EntityVehicle entity, double x, double y, double z, float p_76986_8_,

float partialTicks) {

if(f==null){

f=entity.file;

return;

}

if(f==null) entity.setDead();

//Minecraft.getMinecraft().renderEngine.bindTexture(getEntityTexture(entity));

GL11.glPushMatrix();

GL11.glTranslated(x, y, z);

GL11.glRotated(entity.rotationYaw, 0, 1, 0);

GL11.glRotated(entity.rotationPitch, 1, 0, 0);

GL11.glPushMatrix();

getmodel(f).renderPart(f.modelName);

GL11.glPopMatrix();

//Rearaxis

GL11.glPushMatrix();

GL11.glRotated(entity.backWheelRotation, 1, 0, 0);

GL11.glTranslated(f.wheelPosBack.x+f.wheelPosLeft.x, f.wheelPosBack.y, f.wheelPosBack.z);

getmodel(f).renderPart(f.wheelsName);

GL11.glPopMatrix();

 

//Frontwheel L

GL11.glPushMatrix();

GL11.glRotated(entity.wheelRotL, 1, 0, 0);

GL11.glTranslated(f.wheelPosLeft.x, f.wheelPosLeft.y, f.wheelPosLeft.z);

getmodel(f).renderPart(f.wheelsName);

GL11.glPopMatrix();

 

//Frontwheel R

GL11.glPushMatrix();

GL11.glRotated(entity.wheelRotL, 1, 0, 0);

GL11.glTranslated(f.wheelPosLeft.x, f.wheelPosLeft.y, f.wheelPosLeft.z);

getmodel(f).renderPart(f.wheelsName);

GL11.glPopMatrix();

 

//

GL11.glPopMatrix();

}

 

private IModelCustom getmodel(VehicleFile f) {

return models.get(f.vehicleName);

}

 

@Override

protected ResourceLocation getEntityTexture(Entity entity) {

if(entity instanceof EntityVehicle){

VehicleFile f = ((EntityVehicle)entity).file;

if(f==null){

return null;

}

return textures.get(f.vehicleName);

}else

return null;

}

 

public static void registerModel(VehicleFile f){

models.put(f.vehicleName, AdvancedModelLoader.loadModel(new ResourceLocation("reallifemod:models/vehicle/"+f.fileName+".obj")));

textures.put(f.vehicleName, new ResourceLocation("reallifemod:textures/vehicle/"+f.textureName+".png"));

}

 

}

 

 

 

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.