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.

wilfsadude1

Members
  • Joined

  • Last visited

  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. @CadibooI dont know how to do that
  4. @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; } }
  5. @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
  6. @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
  7. 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
  8. so now do i have to add a texture for the entity if so where
  9. 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; } }
  10. so i dont need that part
  11. 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
  12. @Cadiboo so what code would i use in the class
  13. @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
  14. 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); } }

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.