public static void registerItemRenderers() { MinecraftForgeClient.registerItemRenderer(ARItems.shuttleItem, new ItemRendererShuttle(rocketModel)); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ARBlocks.blockShuttleDock.getBlock()), new ItemRendererSpecial1()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ARBlocks.metaBlockMothershipEngineJet), new ItemRendererJet( new IModelCustom[]{engineModel, engineModelIon}, new ResourceLocation[] { new ResourceLocation(AmunRa.instance.ASSETPREFIX, "textures/model/jet.png"), new ResourceLocation(AmunRa.instance.ASSETPREFIX, "textures/model/jet-ion.png") } )); }
@Override public void registerRenderInformation() { ClientRegistry.bindTileEntitySpecialRenderer(SCVenusTileEntityTreasureChest.class, new SCVenusTileEntityTreasureChestRenderer()); RenderingRegistry.addNewArmourRendererPrefix("gem"); RenderingRegistry.addNewArmourRendererPrefix("sulfer"); RenderingRegistry.addNewArmourRendererPrefix("jetpack"); RenderingRegistry.registerEntityRenderingHandler(SCVenusEntityVenusianVillager.class, new SCVenusRenderVenusianVillager()); RenderingRegistry.registerEntityRenderingHandler(SCVenusEntityFlameling.class, new SCVenusRenderFlameling()); RenderingRegistry.registerEntityRenderingHandler(SCVenusEntityEvolvedBlaze.class, new SCVenusRenderEvolvedBlaze()); IModelCustom cargoRocketModel = AdvancedModelLoader.loadModel("/assets/galacticraftmars/models/cargoRocket.obj"); RenderingRegistry.registerEntityRenderingHandler(SCVenusEntityRocketT3.class, new GCCoreRenderSpaceship(new SCCoreModelSpaceshipTier3(), VenusCore.ASSET_DOMAIN, "rocketT3")); MinecraftForgeClient.registerItemRenderer(VenusItems.spaceshipT3.itemID, new SCVenusItemRendererSpaceshipT3(cargoRocketModel)); }
@Override public void postInit(FMLPostInitializationEvent event) { IModelCustom chamberModel = AdvancedModelLoader.loadModel(new ResourceLocation(MarsModule.ASSET_PREFIX, "models/chamber.obj")); IModelCustom cargoRocketModel = AdvancedModelLoader.loadModel(new ResourceLocation(MarsModule.ASSET_PREFIX, "models/cargoRocket.obj")); // Tile Entity Renderers ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTreasureChestMars.class, new TileEntityTreasureChestRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCryogenicChamber.class, new TileEntityCryogenicChamberRenderer(chamberModel)); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTerraformer.class, new TileEntityBubbleProviderRenderer(0.25F, 1.0F, 0.25F)); // Entities RenderingRegistry.registerEntityRenderingHandler(EntitySludgeling.class, new RenderSludgeling()); RenderingRegistry.registerEntityRenderingHandler(EntitySlimeling.class, new RenderSlimeling()); RenderingRegistry.registerEntityRenderingHandler(EntityCreeperBoss.class, new RenderCreeperBoss()); RenderingRegistry.registerEntityRenderingHandler(EntityTier2Rocket.class, new RenderTier1Rocket(new ModelTier2Rocket(), MarsModule.ASSET_PREFIX, "rocketT2")); // RenderingRegistry.registerEntityRenderingHandler(EntityTerraformBubble.class, new RenderBubble(0.25F, 1.0F, 0.25F)); RenderingRegistry.registerEntityRenderingHandler(EntityProjectileTNT.class, new RenderProjectileTNT()); RenderingRegistry.registerEntityRenderingHandler(EntityLandingBalloons.class, new RenderLandingBalloons()); RenderingRegistry.registerEntityRenderingHandler(EntityLandingBalloons.class, new RenderLandingBalloons()); RenderingRegistry.registerEntityRenderingHandler(EntityCargoRocket.class, new RenderCargoRocket(cargoRocketModel)); // Add Armor Renderer Prefix RenderingRegistry.addNewArmourRendererPrefix("desh"); // Item Renderers MinecraftForgeClient.registerItemRenderer(MarsItems.spaceship, new ItemRendererTier2Rocket(cargoRocketModel)); MinecraftForgeClient.registerItemRenderer(MarsItems.key, new ItemRendererKey(new ResourceLocation(MarsModule.ASSET_PREFIX, "textures/model/treasure.png"))); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(MarsBlocks.machine), new ItemRendererMachine(chamberModel)); }
@Override public void postInit(FMLPostInitializationEvent event) { RenderingRegistry.registerEntityRenderingHandler(EntitySmallAsteroid.class, new RenderSmallAsteroid()); RenderingRegistry.registerEntityRenderingHandler(EntityGrapple.class, new RenderGrapple()); IModelCustom podModel = AdvancedModelLoader.loadModel(new ResourceLocation(AsteroidsModule.ASSET_PREFIX, "models/pod.obj")); RenderingRegistry.registerEntityRenderingHandler(EntityEntryPod.class, new RenderEntryPod(podModel)); IModelCustom rocketModel = AdvancedModelLoader.loadModel(new ResourceLocation(AsteroidsModule.ASSET_PREFIX, "models/tier3rocket.obj")); RenderingRegistry.registerEntityRenderingHandler(EntityTier3Rocket.class, new RenderTier3Rocket(rocketModel, AsteroidsModule.ASSET_PREFIX, "tier3rocket")); RenderingRegistry.registerEntityRenderingHandler(EntityAstroMiner.class, new RenderAstroMiner()); IModelCustom grappleModel = AdvancedModelLoader.loadModel(new ResourceLocation(AsteroidsModule.ASSET_PREFIX, "models/grapple.obj")); MinecraftForgeClient.registerItemRenderer(AsteroidsItems.grapple, new ItemRendererGrappleHook(grappleModel)); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(AsteroidBlocks.beamReceiver), new ItemRendererBeamReceiver()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(AsteroidBlocks.beamReflector), new ItemRendererBeamReflector()); MinecraftForgeClient.registerItemRenderer(AsteroidsItems.tier3Rocket, new ItemRendererTier3Rocket(rocketModel)); MinecraftForgeClient.registerItemRenderer(AsteroidsItems.astroMiner, new ItemRendererAstroMiner()); MinecraftForgeClient.registerItemRenderer(AsteroidsItems.thermalPadding, new ItemRendererThermalArmor()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(AsteroidBlocks.shortRangeTelepad), new ItemRendererShortRangeTelepad()); MinecraftForgeClient.registerItemRenderer(AsteroidsItems.heavyNoseCone, new ItemRendererHeavyNoseCone()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(AsteroidBlocks.blockWalkway), new ItemRendererWalkway()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(AsteroidBlocks.blockWalkwayOxygenPipe), new ItemRendererWalkway()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(AsteroidBlocks.blockWalkwayWire), new ItemRendererWalkway()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBeamReflector.class, new TileEntityBeamReflectorRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBeamReceiver.class, new TileEntityBeamReceiverRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMinerBase.class, new TileEntityMinerBaseRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShortRangeTelepad.class, new TileEntityShortRangeTelepadRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTreasureChestAsteroids.class, new TileEntityTreasureChestRenderer()); if (Loader.isModLoaded("craftguide")) CraftGuideIntegration.register(); }
protected void renderJet(ItemRenderType type, RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) { // TODO get a better idea how to do this ResourceLocation texture = textures[item.getItemDamage()]; IModelCustom model = models[item.getItemDamage()]; switch(type) { case ENTITY: GL11.glScaled(0.53, 0.53, 0.53); GL11.glTranslated(0.0, 1.0, 1.0); break; case EQUIPPED: GL11.glScaled(0.53, 0.53, 0.53); GL11.glTranslated(2.0, 0.8, 1.5); GL11.glRotated(90, 0, 1, 0); break; case EQUIPPED_FIRST_PERSON: GL11.glScaled(0.53, 0.53, 0.53); GL11.glTranslated(1.9, 1.0, 1.0); GL11.glRotated(90, 0, 1, 0); break; case INVENTORY: GL11.glTranslated(0.5, 0.35, 0.0); GL11.glScaled(0.53, 0.53, 0.53); GL11.glRotated(180, 0, 1, 0); break; default: break; } GL11.glPushMatrix(); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); Minecraft.getMinecraft().renderEngine.bindTexture(texture); model.renderAll(); GL11.glPopMatrix(); }
@Override public IModelCustom loadInstance(ResourceLocation resource) throws ModelFormatException { IResource res; try { res = Minecraft.getMinecraft().getResourceManager() .getResource(resource); } catch (IOException e) { throw new ModelFormatException("IO Exception reading model format", e); } return LoadFromStream(res.getInputStream()); }
@Override public void render(ItemStack wandStack) { if(RenderManager.instance.renderEngine == null) return; ItemWandCasting wand = (ItemWandCasting)wandStack.getItem(); String tag = wand.getRod(wandStack).getTag(); if(CustomModels.containsKey(tag)){ IModelCustom model = CustomModels.get(tag); render(wandStack,model); }else super.render(wandStack); }
public SimpleBlockOBJRenderer(Addon addon, int renderID, ResourceLocation modelLocation) { super(addon, renderID); final IModelCustom temp = AdvancedModelLoader.loadModel(modelLocation); if (!(temp instanceof WavefrontObject)) { throw new IllegalArgumentException("SimpleBlockOBJRenderer is only for WaveFrontObjects (.obj)!"); } model = (WavefrontObject) temp; }
/** * Creates a renderer using properties from a {@link org.obsidianbox.magma.block.SimpleBlock} * * This will also set the render type for that block * @param addon The addon creating the block * @param renderID The render type used by Forge * @param block Block being rendered */ public SimpleBlockOBJRenderer(Addon addon, int renderID, SimpleBlock block) { super(addon, renderID); final IModelCustom temp = AdvancedModelLoader.loadModel(new ResourceLocation(addon.getDescription().getIdentifier(), "models/blocks/" + block.getIdentifier() + ".obj")); if (!(temp instanceof WavefrontObject)) { throw new IllegalArgumentException("SimpleBlockOBJRenderer is only for WaveFrontObjects (.obj)!"); } model = (WavefrontObject) temp; block.setRenderType(renderID); }
@Override public void registerRenderInformation() { IModelCustom cargoRocketModel = AdvancedModelLoader.loadModel("/assets/galacticraftmars/models/cargoRocket.obj"); // TODO remove internal cargo rocket codes RenderingRegistry.registerEntityRenderingHandler(SCJupiterEntityRocketT5.class, new GCCoreRenderSpaceship(new SCJupiterModelSpaceshipTier5(), MoonsCore.ASSET_DOMAIN, "rocketT5")); MinecraftForgeClient.registerItemRenderer(JupiterItems.spaceshipT5.itemID, new SCJupiterItemRendererSpaceshipT5(cargoRocketModel)); }
@Override public void registerRenderInformation() { IModelCustom cargoRocketModel = AdvancedModelLoader.loadModel("/assets/galacticraftmars/models/cargoRocket.obj"); // TODO remove internal cargo rocket codes RenderingRegistry.registerEntityRenderingHandler(SCMercuryEntityRocketT4.class, new GCCoreRenderSpaceship(new SCMercuryModelSpaceshipTier4(), MercuryCore.ASSET_DOMAIN, "rocketT4")); MinecraftForgeClient.registerItemRenderer(MercuryItems.spaceshipT4.itemID, new SCMercuryItemRendererSpaceshipT4(cargoRocketModel)); }
@Override public void registerRenderInformation() { RenderingRegistry.addNewArmourRendererPrefix("gravity"); IModelCustom cargoRocketModel = AdvancedModelLoader.loadModel("/assets/galacticraftmars/models/cargoRocket.obj"); // TODO remove internal cargo rocket codes RenderingRegistry.registerEntityRenderingHandler(SCSednaEntityRocketT6.class, new GCCoreRenderSpaceship(new SCSednaModelSpaceshipTier6(), SednaCore.ASSET_DOMAIN, "rocketT6")); MinecraftForgeClient.registerItemRenderer(SednaItems.spaceshipT6.itemID, new SCSednaItemRendererSpaceshipT6(cargoRocketModel)); }
public RenderCargoRocket(IModelCustom model) { this.shadowSize = 0.5F; this.rocketModel = model; }
public TileEntityCryogenicChamberRenderer(IModelCustom model) { this.model = model; }
public ItemRendererTier2Rocket(IModelCustom cargoRocketModel) { super(new EntityTier2Rocket(FMLClientHandler.instance().getClient().theWorld), new ModelTier2Rocket(), new ResourceLocation(MarsModule.ASSET_PREFIX, "textures/model/rocketT2.png")); this.cargoRocketModel = cargoRocketModel; }
public ItemRendererMachine(IModelCustom model) { this.model = model; }
public RenderEntryPod(IModelCustom model) { modelEntryPod = model; }
public RenderTier3Rocket(IModelCustom spaceshipModel, String textureDomain, String texture) { this.rocketModelObj = spaceshipModel; this.rocketTexture = new ResourceLocation(textureDomain, "textures/model/" + texture + ".png"); this.shadowSize = 2F; }
public ItemRendererTier3Rocket(IModelCustom model) { this.modelSpaceship = model; }
public ItemRendererGrappleHook(IModelCustom modelGrapple) { ItemRendererGrappleHook.modelGrapple = modelGrapple; }
public void renderModelAt(TileEntityAluminumWire tileEntity, double d, double d1, double d2, float f) { // Texture file FMLClientHandler.instance().getClient().renderEngine.bindTexture(TileEntityAluminumWireRenderer.aluminumWireTexture); GL11.glPushMatrix(); GL11.glTranslatef((float) d + 0.5F, (float) d1 + 0.5F, (float) d2 + 0.5F); GL11.glScalef(1.0F, -1F, -1F); TileEntity[] adjecentConnections = EnergyUtil.getAdjacentPowerConnections(tileEntity); int metadata = tileEntity.getWorldObj().getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); IModelCustom model = null; if (metadata == 0) { model = this.model; } else { model = this.model2; } if (adjecentConnections[0] != null) { model.renderPart("Top"); } if (adjecentConnections[1] != null) { model.renderPart("Bottom"); } if (adjecentConnections[2] != null) { model.renderPart("Front"); } if (adjecentConnections[3] != null) { model.renderPart("Back"); } if (adjecentConnections[4] != null) { model.renderPart("Right"); } if (adjecentConnections[5] != null) { model.renderPart("Left"); } model.renderPart("Middle"); GL11.glPopMatrix(); }
public RenderTier1Rocket(IModelCustom spaceshipModel, String textureDomain, String texture) { this(new ResourceLocation(textureDomain, "textures/model/" + texture + ".png")); this.modelSpaceshipObj = spaceshipModel; }
@Override public IModelCustom loadInstance(ResourceLocation resource) throws ModelFormatException { return new WavefrontObject(resource); }
@Override public IModelCustom loadInstance(ResourceLocation resource) throws ModelFormatException { return new TechneModel(resource); }
public CustomPartedModel(IModelCustom _model) { this(_model, null); }
public CustomPartedModel(IModelCustom _model, String _part) { model = _model; name = _part; }
public TileEntityModelCustom(IModelCustom model) { theModel = model; }
public ItemModelCustom(IModelCustom model) { theModel = model; }
public ItemRendererShuttle(IModelCustom model) { this.modelSpaceship = model; }
public ItemRendererJet(IModelCustom[] models, ResourceLocation[] textures) { // TODO find a better idea this.models = models; this.textures = textures; }
public RenderMothershipJet(IModelCustom leModel, ResourceLocation texture) { this.model = leModel; this.texture = texture; }
public RenderShuttle(IModelCustom spaceshipModel, String textureDomain, String texture) { this.rocketModelObj = spaceshipModel; this.rocketTexture = new ResourceLocation(textureDomain, "textures/model/" + texture + ".png"); this.shadowSize = 2F; }
public ModelObjRenderer(ModelBase bass, IModelCustom shape) { this(bass, shape, 1F); }
public ModelObjRenderer(ModelBase bass, IModelCustom shape, float scale) { super(bass); theScale = scale; model = shape; }
@Override public IModelCustom loadInstance(String resourceName, URL resource) throws ModelFormatException { return new TechneModel( resourceName, resource ); }