public static WavefrontObject getFrameModel() { if (framemodel == null) { framemodel = (WavefrontObject) AdvancedModelLoader.loadModel(Config.RESOURCE_PREFIX + "models/lightBase.obj"); } return framemodel; }
public static WavefrontObject getLightModel() { if (lightmodel == null) { lightmodel = (WavefrontObject) AdvancedModelLoader.loadModel(Config.RESOURCE_PREFIX + "models/lightCore.obj"); } return lightmodel; }
@Override public void preInit() { super.preInit(); EventUtil.register(ClientTimerHandler.INSTANCE, EventUtil.Type.BOTH); File file = new File(Subsistence.configPath + "foliage.json"); if (file.exists()) { FoliageHandler.initialize(file); } else { FoliageHandler.initialize(null); } AdvancedModelLoader.registerModelHandler(new FixedTechneModelLoader()); // TILE ClientRegistry.bindTileEntitySpecialRenderer(TileTable.class, new RenderTileTable()); ClientRegistry.bindTileEntitySpecialRenderer(TileSieveTable.class, new RenderTileSieveTable()); ClientRegistry.bindTileEntitySpecialRenderer( TileSinteringOven.class, new RenderTileSinteringOven()); ClientRegistry.bindTileEntitySpecialRenderer(TileHammerMill.class, new RenderTileHammerMill()); ClientRegistry.bindTileEntitySpecialRenderer(TileHandCrank.class, new RenderTileCrank()); ClientRegistry.bindTileEntitySpecialRenderer( TileKineticCrank.class, new RenderTileKineticCrank()); ClientRegistry.bindTileEntitySpecialRenderer(TileWaterMill.class, new RenderTileWaterMill()); ClientRegistry.bindTileEntitySpecialRenderer(TileKiln.class, new RenderTileKiln()); ClientRegistry.bindTileEntitySpecialRenderer(TileMetalPress.class, new RenderTileMetalPress()); ClientRegistry.bindTileEntitySpecialRenderer( TileSpawnMarker.class, new RenderTileSpawnMarker()); ClientRegistry.bindTileEntitySpecialRenderer(TileMetalShaft.class, new RenderTileMetalShaft()); ClientRegistry.bindTileEntitySpecialRenderer(TileCompost.class, new RenderTileCompost()); ClientRegistry.bindTileEntitySpecialRenderer(TileBarrel.class, new RenderTileBarrel()); // ITEM MinecraftForgeClient.registerItemRenderer( Item.getItemFromBlock(SubsistenceBlocks.table), new RenderItemTable()); MinecraftForgeClient.registerItemRenderer( Item.getItemFromBlock(SubsistenceBlocks.tableSieve), new RenderItemSieveTable()); MinecraftForgeClient.registerItemRenderer( Item.getItemFromBlock(SubsistenceBlocks.sinteringOven), new RenderItemSinteringOven()); MinecraftForgeClient.registerItemRenderer( Item.getItemFromBlock(SubsistenceBlocks.hammerMill), new RenderItemHammerMill()); MinecraftForgeClient.registerItemRenderer( Item.getItemFromBlock(SubsistenceBlocks.kineticCrank), new RenderItemKineticCrank()); MinecraftForgeClient.registerItemRenderer( Item.getItemFromBlock(SubsistenceBlocks.kiln), new RenderItemKiln()); MinecraftForgeClient.registerItemRenderer( Item.getItemFromBlock(SubsistenceBlocks.metalPress), new RenderItemMetalPress()); MinecraftForgeClient.registerItemRenderer( Item.getItemFromBlock(SubsistenceBlocks.spawnMarker), new RenderItemSpawnMarker()); MinecraftForgeClient.registerItemRenderer( Item.getItemFromBlock(SubsistenceBlocks.compost), new RenderItemCompost()); MinecraftForgeClient.registerItemRenderer( Item.getItemFromBlock(SubsistenceBlocks.barrel), new RenderItemBarrel()); MinecraftForgeClient.registerItemRenderer( SubsistenceItems.barrelLid, new RenderItemBarrelLid()); }
public class RedstoneIngotRenderer extends TileEntitySpecialRenderer { public static final ResourceLocation TEXTURE = new ResourceLocation("kitsumedievalcraft:models/MyRedstoneBlock.png"); public static final ResourceLocation TEXTURE1 = new ResourceLocation("kitsumedievalcraft:models/MyHotRedstoneBlock.png"); private static final ResourceLocation MODEL_BASE = new ResourceLocation("kitsumedievalcraft:models/IronIngotBlock.obj"); private IModelCustom model = AdvancedModelLoader.loadModel(MODEL_BASE); @Override public void renderTileEntityAt(TileEntity tileEnt, double x, double y, double z, float scale) { GL11.glPushMatrix(); GL11.glTranslatef((float) x, (float) y, (float) z); GL11.glScalef(0.3F, 0.3F, 0.3F); GL11.glTranslatef(1.65F, 0.175F, 1.75F); GL11.glRotatef(15F, 0F, 1F, 0F); TileRedstoneIngot tile = (TileRedstoneIngot) tileEnt; if (tile.hot == true) { FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE1); tile.markForUpdate(); tile.markDirty(); } if (tile.hot == false) { FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); tile.markForUpdate(); tile.markDirty(); } renderBlock( tile, tileEnt.getWorldObj(), tileEnt.xCoord, tileEnt.yCoord, tileEnt.zCoord, ModBlocks.redstoneIngot); GL11.glPopMatrix(); } @SuppressWarnings({"cast"}) public void renderBlock(TileRedstoneIngot tl, World world, int i, int j, int k, Block block) { GL11.glPushMatrix(); this.model.renderAll(); GL11.glPopMatrix(); } }
private ModelHorseWalker() { modelBase = AdvancedModelLoader.loadModel(MODEL_BASE); modelWalker = AdvancedModelLoader.loadModel(MODEL_WALKER); modelSideGear = AdvancedModelLoader.loadModel(MODEL_SIDE_GEAR); }
public ModelFancyNode() { modelFancyNode = AdvancedModelLoader.loadModel("/assets/letsmod/models/fancyNode.obj"); }
public class RenderEntityDeconstructor extends TileEntitySpecialRenderer { public static final IModelCustom model = AdvancedModelLoader.loadModel( new ResourceLocation("thaumicbases", "models/entityDeconstructor/deconstructor.obj")); public static final ResourceLocation frameIcon = new ResourceLocation("thaumicbases", "textures/blocks/entityDeconstructor/goldbase.png"); public static final ResourceLocation glassIcon = new ResourceLocation("thaumicbases", "textures/blocks/entityDeconstructor/glass.png"); public static final ResourceLocation air = new ResourceLocation("thaumicbases", "textures/blocks/crystal/air.png"); public static final ResourceLocation fire = new ResourceLocation("thaumicbases", "textures/blocks/crystal/fire.png"); public static final ResourceLocation water = new ResourceLocation("thaumicbases", "textures/blocks/crystal/water.png"); public static final ResourceLocation earth = new ResourceLocation("thaumicbases", "textures/blocks/crystal/earth.png"); public static final ResourceLocation ordo = new ResourceLocation("thaumicbases", "textures/blocks/crystal/order.png"); public static final ResourceLocation entropy = new ResourceLocation("thaumicbases", "textures/blocks/crystal/entropy.png"); @Override public void renderTileEntityAt( TileEntity tile, double screenX, double screenY, double screenZ, float partialTicks) { GL11.glPushMatrix(); TileEntityDeconstructor d = (TileEntityDeconstructor) tile; GL11.glTranslated(screenX + 0.5D, screenY, screenZ + 0.5D); GL11.glScalef(0.4F, 0.4F, 0.4F); Minecraft.getMinecraft().renderEngine.bindTexture(frameIcon); model.renderPart("Cube_Cube.001"); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); Minecraft.getMinecraft().renderEngine.bindTexture(glassIcon); model.renderPart("Plane"); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDepthMask(true); char c0 = 61680; int j = c0 % 65536; int k = c0 / 65536; OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); if (d.hasAir) { Minecraft.getMinecraft().renderEngine.bindTexture(air); model.renderPart("Sphere"); } if (d.hasFire) { Minecraft.getMinecraft().renderEngine.bindTexture(fire); model.renderPart("Sphere.001"); } if (d.hasWater) { Minecraft.getMinecraft().renderEngine.bindTexture(water); model.renderPart("Sphere.002"); } if (d.hasEarth) { Minecraft.getMinecraft().renderEngine.bindTexture(earth); model.renderPart("Sphere.003"); } if (d.hasOrdo) { Minecraft.getMinecraft().renderEngine.bindTexture(ordo); model.renderPart("Sphere.004"); } if (d.hasEntropy) { Minecraft.getMinecraft().renderEngine.bindTexture(entropy); model.renderPart("Sphere.005"); } GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glPopMatrix(); } }
public class IRSmallBarrel implements IItemRenderer { public static final ResourceLocation MODEL = new ResourceLocation("kitsumedievalcraft:models/BarrelFinished.obj"); public static final ResourceLocation TEXTURE = new ResourceLocation("kitsumedievalcraft:models/BarrelFinished.png"); public IModelCustom model = AdvancedModelLoader.loadModel(MODEL); @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { switch (type) { case EQUIPPED: { return true; } case EQUIPPED_FIRST_PERSON: { return true; } case INVENTORY: { return true; } case ENTITY: { return true; } default: return false; } } @Override public boolean shouldUseRenderHelper( ItemRenderType type, ItemStack item, ItemRendererHelper helper) { switch (type) { case EQUIPPED: { return helper == ItemRendererHelper.BLOCK_3D; } case EQUIPPED_FIRST_PERSON: { return helper == ItemRendererHelper.EQUIPPED_BLOCK; } case INVENTORY: { return helper == ItemRendererHelper.INVENTORY_BLOCK; } case ENTITY: { return (helper == ItemRendererHelper.ENTITY_BOBBING || helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.BLOCK_3D); } default: return false; } } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch (type) { case EQUIPPED: { GL11.glPushMatrix(); float scale = 0.325F; GL11.glScalef(scale, scale, scale); GL11.glTranslatef(3.2F, -0.75F, -0.2F); // ANGLE, X ROTATE, Y ROTATE, Z ROTATE GL11.glRotatef(22F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(-45F, 0.0F, 1.0F, 0.0F); Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE); model.renderAll(); GL11.glPopMatrix(); } break; case EQUIPPED_FIRST_PERSON: { float f = 0.5F; GL11.glPushMatrix(); GL11.glScalef(f, f, f); // ANGLE, X ROTATE, Y ROTATE, Z ROTATE // GL11.glRotatef(-135F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-45F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(1.0F, -0.9F, 0.3F); Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE); model.renderAll(); GL11.glPopMatrix(); } break; case INVENTORY: { GL11.glPushMatrix(); GL11.glEnable(GL11.GL_TEXTURE_2D); float scale = 0.4F; GL11.glScalef(scale, scale, scale); // GL11.glRotatef(90, 1.0F, 0.0F, 0.0F); GL11.glTranslatef(0.0F, -1.4F, 0.0F); Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE); model.renderAll(); GL11.glPopMatrix(); } break; case ENTITY: { GL11.glPushMatrix(); float scale = 0.5F; GL11.glScalef(scale, scale, scale); GL11.glTranslatef(0.0F, -0.4F, 0.0F); Minecraft.getMinecraft().renderEngine.bindTexture(TEXTURE); model.renderAll(); GL11.glPopMatrix(); } break; default: break; } } }
public class BarrelLidRender extends TileEntitySpecialRenderer { public static final ResourceLocation MODEL = new ResourceLocation("kitsumedievalcraft:models/BarrelLid.obj"); private ResourceLocation loc; private ResourceLocation TEXTURE9 = new ResourceLocation("kitsumedievalcraft:models/BarrelLidRing.png"); private ResourceLocation TEXTURE8 = new ResourceLocation("kitsumedievalcraft:models/BarrelLid8.png"); private ResourceLocation TEXTURE7 = new ResourceLocation("kitsumedievalcraft:models/BarrelLid7.png"); private ResourceLocation TEXTURE6 = new ResourceLocation("kitsumedievalcraft:models/BarrelLid6.png"); private ResourceLocation TEXTURE5 = new ResourceLocation("kitsumedievalcraft:models/BarrelLid5.png"); private ResourceLocation TEXTURE4 = new ResourceLocation("kitsumedievalcraft:models/BarrelLid4.png"); private ResourceLocation TEXTURE3 = new ResourceLocation("kitsumedievalcraft:models/BarrelLid3.png"); private ResourceLocation TEXTURE2 = new ResourceLocation("kitsumedievalcraft:models/BarrelLid2.png"); private ResourceLocation TEXTURE1 = new ResourceLocation("kitsumedievalcraft:models/BarrelLid1.png"); private ResourceLocation TEXTURE0 = new ResourceLocation("kitsumedievalcraft:models/BarrelLid0.png"); // private IModelCustom model; private IModelCustom model = AdvancedModelLoader.loadModel(MODEL); @Override public void renderTileEntityAt(TileEntity tileEnt, double x, double y, double z, float scale) { GL11.glPushMatrix(); // This will move our renderer so that it will be on proper place in the // world GL11.glTranslatef((float) x, (float) y, (float) z); TileEntitySmallLid tile = (TileEntitySmallLid) tileEnt; if (tile.logs == 0) { loc = TEXTURE0; tile.markForUpdate(); tile.markDirty(); } if (tile.logs == 1) { loc = TEXTURE1; tile.markForUpdate(); tile.markDirty(); } if (tile.logs == 2) { loc = TEXTURE2; tile.markForUpdate(); tile.markDirty(); } if (tile.logs == 3) { loc = TEXTURE3; tile.markForUpdate(); tile.markDirty(); } if (tile.logs == 4) { loc = TEXTURE4; tile.markForUpdate(); tile.markDirty(); } if (tile.logs == 5) { loc = TEXTURE5; tile.markForUpdate(); tile.markDirty(); } if (tile.logs == 6) { loc = TEXTURE6; tile.markForUpdate(); tile.markDirty(); } if (tile.logs == 7) { loc = TEXTURE7; tile.markForUpdate(); tile.markDirty(); } if (tile.logs == 8) { loc = TEXTURE8; tile.markForUpdate(); tile.markDirty(); } if (tile.ring == 1) { loc = TEXTURE9; tile.markForUpdate(); tile.markDirty(); } FMLClientHandler.instance().getClient().renderEngine.bindTexture(loc); renderBlock( tile, tileEnt.getWorldObj(), tileEnt.xCoord, tileEnt.yCoord, tileEnt.zCoord, ModBlocks.smallBarrelLid); GL11.glPopMatrix(); } public void renderBlock(TileEntitySmallLid tl, World world, int i, int j, int k, Block block) { GL11.glPushMatrix(); // GL11.glRotatef(15F, 0F, 1F, 0F); float scale = 0.3F; GL11.glScalef(scale, scale + 0.1F, scale); GL11.glTranslatef(1.66F, 0.06F, 1.66F); GL11.glRotatef(45F, 0.0F, 1.0F, 0.0F); this.model.renderAll(); GL11.glPopMatrix(); } }
public ModelResearchStation() { modelResearchStation = AdvancedModelLoader.loadModel(Models.RESEARCH_STATION); }
public RenderVirtualisationScanner() { texture = new ResourceLocation(Reference.MOD_id, "models/VirtualisationScanner.png"); objModelLocation = new ResourceLocation(Reference.MOD_id, "models/virtualisaton scanner.obj"); model = AdvancedModelLoader.loadModel(objModelLocation); }
public RenderGapingVoid() { this.model = AdvancedModelLoader.loadModel(new ResourceLocation("avaritia", "model/hemisphere.obj")); }
public ModelRenderOBJ( ModelBase baseModel, ResourceLocation customModel, ResourceLocation texture) { super(baseModel); this.model = AdvancedModelLoader.loadModel(customModel); this.texture = texture; }
public ModelLocker() { model = AdvancedModelLoader.loadModel(modelPath()); }
public class TileRenderRedstoneWireConnector extends TileRenderImmersiveConnectable { private static final IModelCustom modelChannel = AdvancedModelLoader.loadModel( new ResourceLocation(ModInfo.MOD_ID, "models/redstoneWireConnectorChannel.obj")); private static final ResourceLocation channelTexture = new ResourceLocation(ModInfo.MOD_ID, "textures/blocks/redstoneWireConnectorChannel.png"); private final ModelIIObj modelOutput = new ModelIIObj( "immersiveintegration:models/redstoneWireConnector.obj", IIBlocks.redstoneWireConnector); private final ModelIEObj modelInput = new ModelIEObj("immersiveintegration:models/redstoneWireConnector.obj") { @Override public IIcon getBlockIcon() { return BlockRedstoneWireConnector.inputIcon; } }; @Override public void renderDynamic(TileEntity tile, double x, double y, double z, float f) { super.renderDynamic(tile, x, y, z, f); if (tile instanceof TileRedstoneWireConnector) { GL11.glPushMatrix(); int hex = ItemDye.field_150922_c[15 - ((TileRedstoneWireConnector) tile).redstoneChannel]; int r = (hex & 0xFF0000) >> 16; int g = (hex & 0xFF00) >> 8; int b = (hex & 0xFF); GL11.glColor3f(r / 255f, g / 255f, b / 255f); GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); if (tile.hasWorldObj()) { switch (tile.getBlockMetadata()) { case 0: break; case 1: GL11.glRotatef(180, 0, 0, 1); break; case 2: GL11.glRotatef(90, 1, 0, 0); break; case 3: GL11.glRotatef(-90, 1, 0, 0); break; case 4: GL11.glRotatef(-90, 0, 0, 1); break; case 5: GL11.glRotatef(90, 0, 0, 1); break; } } Minecraft.getMinecraft().renderEngine.bindTexture(channelTexture); modelChannel.renderAll(); GL11.glPopMatrix(); } } @Override public void renderStatic( TileEntity tile, Tessellator tes, Matrix4 translationMatrix, Matrix4 rotationMatrix) { translationMatrix.translate(.5, .5, .5); if (tile.hasWorldObj()) { switch (tile.getBlockMetadata()) { case 0: break; case 1: rotationMatrix.rotate(Math.toRadians(180), 0, 0, 1); break; case 2: rotationMatrix.rotate(Math.toRadians(90), 1, 0, 0); break; case 3: rotationMatrix.rotate(Math.toRadians(-90), 1, 0, 0); break; case 4: rotationMatrix.rotate(Math.toRadians(-90), 0, 0, 1); break; case 5: rotationMatrix.rotate(Math.toRadians(90), 0, 0, 1); break; } } if (tile.hasWorldObj()) { if (tile instanceof TileRedstoneWireConnector && ((TileRedstoneWireConnector) tile).isInput()) { modelInput.render(tile, tes, translationMatrix, rotationMatrix, 0, false, "connectorMV"); } else { modelOutput.render(tile, tes, translationMatrix, rotationMatrix, 0, false, "connectorMV"); } } else { modelOutput.render(tile, tes, translationMatrix, rotationMatrix, 0, false); } } }
public ModelAlienPowerSource() { modelAlienPowerSource = AdvancedModelLoader.loadModel("/mods/xcraft/models/AlienPowerSource.obj"); }
public RenderTileEnergyStorageCore() { iner_model = AdvancedModelLoader.loadModel( new ResourceLocation( References.MODID.toLowerCase(), "models/power_sphere_layer_1.obj")); }
public HyperCubeModel() { model = AdvancedModelLoader.loadModel(MODEL); }
public ModelTableSaw() { tableSaw = AdvancedModelLoader.loadModel(Models.MODEL_TABLESAW); }
public TileEntityShortRangeTelepadRenderer() { TileEntityShortRangeTelepadRenderer.telepadModel = AdvancedModelLoader.loadModel( new ResourceLocation(AsteroidsModule.ASSET_PREFIX, "models/teleporter.obj")); }
public TransportBlockInventoryRenderer() { block = AdvancedModelLoader.loadModel( new ResourceLocation("m4ththings", "models/TransportBlock.obj")); blockTexture = new ResourceLocation("m4ththings", "models/TransportBlockUV.png"); }
public RenderBlockInjector() { this.modelFrame = AdvancedModelLoader.loadModel(this.objFrame); this.modelGlass = AdvancedModelLoader.loadModel(this.objGlass); }
public RenderTileParticleGen() { stabilizerSphereModel = AdvancedModelLoader.loadModel( new ResourceLocation(References.MODID.toLowerCase(), "models/stabilizer_sphere.obj")); }
public ModelPal() { modelPal = AdvancedModelLoader.loadModel("/assets/pal/models/pal.obj"); }