public TileEntityRenderDisplay() { itemRender = new RenderEntityItem(Minecraft.getMinecraft().getRenderManager(), Minecraft.getMinecraft().getRenderItem()) { @Override protected int getModelCount(ItemStack stack) { return SignedBytes.saturatedCast(Math.min(stack.getCount() / 32, 15) + 1); } @Override public boolean shouldBob() { return false; } @Override public boolean shouldSpreadItems() { return false; } }; }
private static void loadItemRenderer() { if (!hasInitRenderItem) { Minecraft minecraft = Minecraft.getMinecraft(); uniformRenderItem = new RenderEntityItem(minecraft.getRenderManager(), minecraft.getRenderItem()); hasInitRenderItem = true; } }
public RenderDroneAI(EntityDrone drone) { this.drone = drone; renderItem = new RenderEntityItem(Minecraft.getMinecraft().getRenderManager(), Minecraft.getMinecraft().getRenderItem()); //TODO 1.8 test entityItem = new EntityItem(drone.world); update(); }
@EventHandler public void init(FMLInitializationEvent event) { if (exempleEnabled) { logger.info("Registering ISBRH Block Exemple..."); testId = RenderRegistry.getNextAvailableRenderId(); GameRegistry.registerBlock(test, "test"); RenderRegistry.registerBlockHandler(new RenderExample()); RenderRegistry.registerTextureHandler((ITextureHandler) test); } Minecraft mc = Minecraft.getMinecraft(); // Prerequisite ModelManager modelManager = ObfuscationReflectionHelper .getPrivateValue(Minecraft.class, mc, "aL", "field_175617_aL", "modelManager"); RenderManager renderManager = mc.getRenderManager(); IReloadableResourceManager resourceManager = ((IReloadableResourceManager) mc .getResourceManager()); // Render Item Hook RenderItem item = new RenderItemISBRH(mc.getTextureManager(), modelManager, mc.getRenderItem()); ObfuscationReflectionHelper.setPrivateValue(Minecraft.class, mc, item, "X", "field_175621_X", "renderItem"); ObfuscationReflectionHelper.setPrivateValue(Minecraft.class, mc, new ItemRenderer(mc), "Y", "field_175620_Y", "itemRenderer"); renderManager.entityRenderMap.remove(EntityItem.class); renderManager.entityRenderMap.put(EntityItem.class, new RenderEntityItem(renderManager, item)); renderManager.entityRenderMap.remove(EntityItemFrame.class); renderManager.entityRenderMap.put(EntityItemFrame.class, new RenderItemFrame(renderManager, item)); mc.entityRenderer = new EntityRenderer(mc, resourceManager); // Render Block Dispatcher Hook BlockRendererDispatcher rendererDispatcher = new ISBRHDispatcher( mc.getBlockRendererDispatcher(), modelManager.getBlockModelShapes(), mc.gameSettings); ObfuscationReflectionHelper.setPrivateValue(Minecraft.class, mc, rendererDispatcher, "aM", "field_175618_aM", "blockRenderDispatcher"); // Register Reload Listeners resourceManager.registerReloadListener(rendererDispatcher); resourceManager.registerReloadListener(item); resourceManager.registerReloadListener(mc.entityRenderer); }
@Override public void preInit() { OBJLoader.INSTANCE.addDomain(AbyssalCraft.modid); RenderingRegistry.registerEntityRenderingHandler(EntityEvilpig.class, manager -> new RenderEvilPig(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityDepthsGhoul.class, manager -> new RenderDepthsGhoul(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityAbyssalZombie.class, manager -> new RenderAbyssalZombie(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityODBPrimed.class, manager -> new RenderODB(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityODBcPrimed.class, manager -> new RenderODBc(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityJzahar.class, manager -> new RenderJzahar(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityAbygolem.class, manager -> new RenderAbyssalniteGolem(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityDreadgolem.class, manager -> new RenderDreadedAbyssalniteGolem(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityDreadguard.class, manager -> new RenderDreadguard(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityDragonMinion.class, manager -> new RenderDragonMinion(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityDragonBoss.class, manager -> new RenderDragonBoss(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityPSDLTracker.class, manager -> new RenderSnowball(manager, ACItems.powerstone_tracker, Minecraft.getMinecraft().getRenderItem())); RenderingRegistry.registerEntityRenderingHandler(EntityShadowCreature.class, manager -> new RenderShadowCreature(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityShadowMonster.class, manager -> new RenderShadowMonster(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityDreadling.class, manager -> new RenderDreadling(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityDreadSpawn.class, manager -> new RenderDreadSpawn(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityDemonPig.class, manager -> new RenderDemonPig(manager)); RenderingRegistry.registerEntityRenderingHandler(EntitySkeletonGoliath.class, manager -> new RenderSkeletonGoliath(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityChagarothSpawn.class, manager -> new RenderChagarothSpawn(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityChagarothFist.class, manager -> new RenderChagarothFist(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityChagaroth.class, manager -> new RenderChagaroth(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityShadowBeast.class, manager -> new RenderShadowBeast(manager)); RenderingRegistry.registerEntityRenderingHandler(EntitySacthoth.class, manager -> new RenderSacthoth(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityRemnant.class, manager -> new RenderRemnant(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityOmotholGhoul.class, manager -> new RenderOmotholGhoul(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityCoraliumArrow.class, manager -> new RenderCoraliumArrow(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityGatekeeperMinion.class, manager -> new RenderGatekeeperMinion(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityGreaterDreadSpawn.class, manager -> new RenderGreaterDreadSpawn(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityLesserDreadbeast.class, manager -> new RenderLesserDreadbeast(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityDreadSlug.class, manager -> new RenderSnowball(manager, ACItems.dread_fragment, Minecraft.getMinecraft().getRenderItem())); RenderingRegistry.registerEntityRenderingHandler(EntityLesserShoggoth.class, manager -> new RenderLesserShoggoth(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityEvilCow.class, manager -> new RenderEvilCow(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityEvilChicken.class, manager -> new RenderEvilChicken(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityDemonCow.class, manager -> new RenderDemonCow(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityDemonChicken.class, manager -> new RenderDemonChicken(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityGatekeeperEssence.class, manager -> new RenderEntityItem(manager, Minecraft.getMinecraft().getRenderItem())); RenderingRegistry.registerEntityRenderingHandler(EntityEvilSheep.class, manager -> new RenderEvilSheep(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityDemonSheep.class, manager -> new RenderDemonSheep(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityCoraliumSquid.class, manager -> new RenderCoraliumSquid(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityInkProjectile.class, manager -> new RenderSnowball(manager, Items.DYE, Minecraft.getMinecraft().getRenderItem())); RenderingRegistry.registerEntityRenderingHandler(EntityDreadedCharge.class, manager -> new RenderDreadedCharge(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityAntiAbyssalZombie.class, manager -> new RenderAntiAbyssalZombie(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityAntiBat.class, manager -> new RenderAntiBat(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityAntiChicken.class, manager -> new RenderAntiChicken(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityAntiCow.class, manager -> new RenderAntiCow(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityAntiCreeper.class, manager -> new RenderAntiCreeper(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityAntiGhoul.class, manager -> new RenderAntiGhoul(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityAntiPig.class, manager -> new RenderAntiPig(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityAntiPlayer.class, manager -> new RenderAntiPlayer(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityAntiSkeleton.class, manager -> new RenderAntiSkeleton(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityAntiSpider.class, manager -> new RenderAntiSpider(manager)); RenderingRegistry.registerEntityRenderingHandler(EntityAntiZombie.class, manager -> new RenderAntiZombie(manager)); MinecraftForge.EVENT_BUS.register(new AbyssalCraftClientEventHooks()); staff_mode = new KeyBinding("key.staff_mode.desc", Keyboard.KEY_M, "key.abyssalcraft.category"); ClientRegistry.registerKeyBinding(staff_mode); }
public void renderRotatingBlockIntoGUI(GuiWiki gui, ItemStack stack, int x, int y, float scale){ if(entityItem == null) { entityItem = new EntityItem(gui.mc.world); renderItem = new RenderEntityItem(Minecraft.getMinecraft().getRenderManager(), Minecraft.getMinecraft().getRenderItem()){ @Override public boolean shouldBob(){ return false; } }; } entityItem.setItem(stack); GlStateManager.pushMatrix(); GlStateManager.translate(x + 1, y + 13, 20); GlStateManager.scale(40 * scale, 40 * scale, -40 * scale); GlStateManager.rotate(180, 1, 0, 0); GlStateManager.rotate(30, 1, 0, 0); GlStateManager.translate(0.1, 0.1, gui.zLevel); GlStateManager.rotate(-TickHandler.ticksExisted, 0, 1, 0); renderItem.doRender(entityItem, 0.0, 0.0, 0, 0, 0); GlStateManager.popMatrix(); /* RenderBlocks renderBlocks = new RenderBlocks(); Block block = Block.blocksList[stack.itemID]; FMLClientHandler.instance().getClient().renderEngine.bindTexture(TextureMap.locationBlocksTexture); GL11.glPushMatrix(); GL11.glTranslatef(x - 2, y + 3, -3.0F + gui.zLevel); GL11.glScalef(10.0F, 10.0F, 10.0F); GL11.glTranslatef(1.0F, 0.5F, 1.0F); GL11.glScalef(1.0F * scale, 1.0F * scale, -1.0F); GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-TickHandler.ticksExisted, 0.0F, 1.0F, 0.0F); int var10 = Item.itemsList[stack.itemID].getColorFromItemStack(stack, 0); float var16 = (var10 >> 16 & 255) / 255.0F; float var12 = (var10 >> 8 & 255) / 255.0F; float var13 = (var10 & 255) / 255.0F; GL11.glColor4f(var16, var12, var13, 1.0F); GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); renderBlocks.useInventoryTint = true; renderBlocks.renderBlockAsItem(block, stack.getItemDamage(), 1.0F); renderBlocks.useInventoryTint = true; GL11.glPopMatrix();*/ }