Jump to content

wilfsadude1

Members
  • Posts

    18
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

wilfsadude1's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I also have a feeling this could be incorrect protected ResourceLocation getEntityTexture(EntityNuclearBombPrimed entity) { return new ResourceLocation(modid,"nuclear_bomb"); } This is at the bottom of the render class
  2. Ok lol yesterday I was so tired so sorry for acting stupid. Here is my renderer class now however I still get no render @OnlyIn(Dist.CLIENT) public class Renderer extends Render<EntityNuclearBombPrimed> { public Renderer(RenderManager renderManagerIn) { super(renderManagerIn); this.shadowSize = 0.5F; } /** * Renders the desired {@code T} type Entity. */ public void doRender(EntityNuclearBombPrimed entity, double x, double y, double z, float entityYaw, float partialTicks) { BlockRendererDispatcher blockrendererdispatcher = Minecraft.getInstance().getBlockRendererDispatcher(); GlStateManager.pushMatrix(); GlStateManager.translatef((float)x, (float)y + 0.5F, (float)z); if ((float)entity.getFuse() - partialTicks + 1.0F < 10.0F) { float f = 1.0F - ((float)entity.getFuse() - partialTicks + 1.0F) / 10.0F; f = MathHelper.clamp(f, 0.0F, 1.0F); f = f * f; f = f * f; float f1 = 1.0F + f * 0.3F; GlStateManager.scalef(f1, f1, f1); } float f2 = (1.0F - ((float)entity.getFuse() - partialTicks + 1.0F) / 100.0F) * 0.8F; this.bindEntityTexture(entity); GlStateManager.rotatef(-90.0F, 0.0F, 1.0F, 0.0F); GlStateManager.translatef(-0.5F, -0.5F, 0.5F); blockrendererdispatcher.renderBlockBrightness(Blocks.TNT.getDefaultState(), entity.getBrightness()); GlStateManager.translatef(0.0F, 0.0F, 1.0F); if (this.renderOutlines) { GlStateManager.enableColorMaterial(); GlStateManager.enableOutlineMode(this.getTeamColor(entity)); blockrendererdispatcher.renderBlockBrightness(Blocks.TNT.getDefaultState(), 1.0F); GlStateManager.disableOutlineMode(); GlStateManager.disableColorMaterial(); } else if (entity.getFuse() / 5 % 2 == 0) { GlStateManager.disableTexture2D(); GlStateManager.disableLighting(); GlStateManager.enableBlend(); GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.DST_ALPHA); GlStateManager.color4f(1.0F, 1.0F, 1.0F, f2); GlStateManager.polygonOffset(-3.0F, -3.0F); GlStateManager.enablePolygonOffset(); blockrendererdispatcher.renderBlockBrightness(Blocks.TNT.getDefaultState(), 1.0F); GlStateManager.polygonOffset(0.0F, 0.0F); GlStateManager.disablePolygonOffset(); GlStateManager.color4f(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. */ protected ResourceLocation getEntityTexture(EntityNuclearBombPrimed entity) { return new ResourceLocation(modid,"nuclear_bomb"); } } This may sound stupid but do I need to create a separate entity texture or can I use the one for the block like I am now... I'm guessing im wrong
  3. @Cadiboo My renderer class says this public class Renderer extends Render<EntityNuclearBombPrimed> { public Renderer(RenderManager renderManager) { super(renderManager); } @Nullable @Override protected ResourceLocation getEntityTexture(EntityNuclearBombPrimed entity) { return null; } }
  4. @Cabidoo please can you help me as I am stuck on what to do next as it still does not work- sorry for the late response
  5. @Cadiboo After looking in my code for a while I'm guessing i need to change this public EntityNuclearBombPrimed(World worldIn) { super(EntityType.TNT, worldIn); this.preventEntitySpawning = true; this.isImmuneToFire = true; this.setSize(0.98F, 0.98F); } and change the super however i dont know what to change it to
  6. im thinking I change my render class to this public class Renderer extends Render<EntityNuclearBombPrimed> { public Renderer(RenderManager renderManager) { super(renderManager); } @Nullable @Override protected ResourceLocation getEntityTexture(EntityNuclearBombPrimed entity) { return new ResourceLocation(modid,"nuclear_bomb"); } } but it still doesnt render
  7. so now do i have to add a texture for the entity if so where
  8. so it looks like this @SubscribeEvent public static void onRegisterModelsEvent(@Nonnull final ModelRegistryEvent event) { registerEntityRenderers(); LOGGER.debug("Registered entity renderers"); } private static void registerEntityRenderers() { RenderingRegistry.registerEntityRenderingHandler(EntityNuclearBombPrimed.class, Renderer::new); } and the renderer class like this public class Renderer extends Render<EntityNuclearBombPrimed> { public Renderer(RenderManager renderManager) { super(renderManager); } @Nullable @Override protected ResourceLocation getEntityTexture(EntityNuclearBombPrimed entity) { return null; } }
  9. ok ive added it but i get an error here ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "normal")); on the setCustomModelResourceLocation part. It says it doesnt exist
  10. @Cadiboo so what code would i use in the class
  11. @DavidM Oooh so like this public class Renderer extends Render<EntityNuclearBombPrimed> { protected Renderer(RenderManager renderManager) { super(renderManager); } @Nullable @Override protected ResourceLocation getEntityTexture(EntityNuclearBombPrimed entity) { return null; } } now how do I do the proxy thing
  12. Im sorry if this sounds stupid but how do i do that. Also is this correct public class Renderer extends EntityNuclearBombPrimed { public Renderer(World worldIn) { super(worldIn); } }
×
×
  • Create New...

Important Information

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