• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TextureUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中codechicken.lib.texture.TextureUtils的典型用法代码示例。如果您正苦于以下问题:Java TextureUtils类的具体用法?Java TextureUtils怎么用?Java TextureUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TextureUtils类属于codechicken.lib.texture包,在下文中一共展示了TextureUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: preInit

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
@Override
public void preInit() {

    super.preInit();
    GuiWirelessSniffer.loadColours(SaveManager.config().getTag("addon"));
    TextureUtils.addIconRegister(new RenderWireless());
    TextureUtils.addIconRegister(new RemoteTexManager());
    TextureUtils.addIconRegister(new TriangTexManager());
    PacketCustom.assignHandler(NET_CHANNEL, new WRClientPH());

    MapRenderRegistry.registerMapRenderer(ModItems.itemWirelessMap, new WirelessMapRenderer());

    RenderingRegistry.registerEntityRenderingHandler(EntityREP.class, manager -> new RenderSnowball<>(manager, itemRep, Minecraft.getMinecraft().getRenderItem()));
    RenderingRegistry.registerEntityRenderingHandler(EntityWirelessTracker.class, RenderTracker::new);
    registerModels();
}
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:17,代码来源:ProxyClient.java


示例2: renderTracker

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
public static void renderTracker(int freq)
{
    GlStateManager.disableLighting();

    TextureUtils.bindBlockTexture();
    CCRenderState ccrs = CCRenderState.instance();
    ccrs.reset();
    ccrs.startDrawing(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    ccrs.colour = 0xFFFFFFFF;
    model.render(ccrs, new IconTransformation(TextureUtils.getBlockTexture("obsidian")));
    ccrs.draw();
    
    Matrix4 pearlMat = RenderUtils.getMatrix(
        new Vector3(0, 0.44+RedstoneEther.getSineWave(ClientUtils.getRenderTime(), 7)*0.02, 0),
        new Rotation(RedstoneEther.getRotation(ClientUtils.getRenderTime(), freq), new Vector3(0, 1, 0)),
        0.04);

    TextureUtils.changeTexture("wrcbe:textures/hedronmap.png");
    ccrs.startDrawing(4, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    ccrs.colour = freq == 0 ? 0xC0C0C0FF : 0xFFFFFFFF;
    CCModelLibrary.icosahedron4.render(ccrs, pearlMat);
    ccrs.draw();

    GlStateManager.enableLighting();
}
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:26,代码来源:RenderTracker.java


示例3: renderPearl

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
public static void renderPearl(CCRenderState ccrs, Vector3 pos, WirelessPart p) {
    GlStateManager.pushMatrix();

    pos.translation().glApply();
    p.rotationT().at(center).glApply();
    p.getPearlPos().translation().glApply();
    p.getPearlRotation().glApply();
    new Scale(p.getPearlScale()).glApply();
    float light = 1;
    if (p.tile() != null) {
        GlStateManager.rotate((float) (p.getPearlSpin() * MathHelper.todeg), 0, 1, 0);
        light = p.getPearlLight();
    }

    GlStateManager.disableLighting();
    ccrs.reset();
    TextureUtils.changeTexture("wrcbe:textures/hedronmap.png");
    ccrs.pullLightmap();
    ccrs.colour = Colour.packRGBA(light, light, light, 1);
    ccrs.startDrawing(4, DefaultVertexFormats.POSITION_TEX_NORMAL);
    CCModelLibrary.icosahedron4.render(ccrs);
    ccrs.draw();
    GlStateManager.enableLighting();

    GlStateManager.popMatrix();
}
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:27,代码来源:RenderWireless.java


示例4: registerIcons

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
public void registerIcons(TextureMap textureMap) {

        for (int i = 0; i < icons.length; i++) {
            icons[i] = TextureUtils.getTextureSpecial(textureMap, "wrcbe:remote_" + i);
        }

        texOn = TextureUtils.loadTextureColours(new ResourceLocation("wrcbe", "textures/items/remote_on.png"));
        texOff = TextureUtils.loadTextureColours(new ResourceLocation("wrcbe", "textures/items/remote_off.png"));
        texGrad = TextureUtils.loadTextureColours(new ResourceLocation("wrcbe", "textures/items/remote_grad.png"));

        for (int i = 0; i < RedstoneEther.numcolours; i++) {
            processTexture(RedstoneEther.colours[i], false, getIconIndex(i, false));
            processTexture(RedstoneEther.colours[i], true, getIconIndex(i, true));
        }
        processTexture(0xFFFFFFFF, false, getIconIndex(-1, false));
        processTexture(0xFFFFFFFF, true, getIconIndex(-1, true));
    }
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:18,代码来源:RemoteTexManager.java


示例5: drawGuiContainerBackgroundLayer

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    TextureUtils.changeTexture(chestInv.getSize() == 0 ? "textures/gui/container/dispenser.png" : "textures/gui/container/generic_54.png");
    int x = (width - xSize) / 2;
    int y = (height - ySize) / 2;

    switch (chestInv.getSize()) {
        case 0:
        case 2:
            drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
            break;
        case 1:
            drawTexturedModalRect(x, y, 0, 0, xSize, 71);
            drawTexturedModalRect(x, y + 71, 0, 126, xSize, 96);
            break;

    }
}
 
开发者ID:TheCBProject,项目名称:EnderStorage,代码行数:19,代码来源:GuiEnderItemStorage.java


示例6: onModelBake

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
@SubscribeEvent (priority = EventPriority.HIGHEST)
public void onModelBake(ModelBakeEvent event) {

    IModel missingIModel = ModelLoaderRegistry.getMissingModel();
    IBakedModel missingModel = missingIModel.bake(missingIModel.getDefaultState(), DefaultVertexFormats.ITEM, TextureUtils.bakedTextureGetter);
    Map<IModel, IBakedModel> bakedModels = new HashMap<>();
    HashMultimap<IModel, ModelResourceLocation> models = HashMultimap.create();
    Multimaps.invertFrom(Multimaps.forMap(toBake), models);

    ProgressBar bar = ProgressManager.push("CCL ModelLoading: Baking", models.keySet().size());

    for (IModel model : models.keySet()) {
        bar.step(String.format("[%s]", Joiner.on(", ").join(models.get(model))));
        if (model == missingIModel) {
            bakedModels.put(model, missingModel);
            continue;
        }
        bakedModels.put(model, model.bake(model.getDefaultState(), DefaultVertexFormats.ITEM, TextureUtils.bakedTextureGetter));
    }
    ProgressManager.pop(bar);

    for (Entry<ModelResourceLocation, IModel> entry : toBake.entrySet()) {
        event.getModelRegistry().putObject(entry.getKey(), bakedModels.get(entry.getValue()));
    }

}
 
开发者ID:TheCBProject,项目名称:CodeChickenLib,代码行数:27,代码来源:CCBlockStateLoader.java


示例7: drawGuiContainerBackgroundLayer

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) {
    GlStateManager.color(1, 1, 1, 1);
    TextureUtils.changeTexture("nei:textures/gui/recipebg.png");
    int j = (width - xSize) / 2;
    int k = (height - ySize) / 2;
    drawTexturedModalRect(j, k, 0, 0, xSize, ySize);

    GlStateManager.pushMatrix();
    GlStateManager.translate(j + 5, k + 16, 0);
    IRecipeHandler recipehandler = currenthandlers.get(recipetype);
    for (int i = page * recipehandler.recipiesPerPage(); i < recipehandler.numRecipes() && i < (page + 1) * recipehandler.recipiesPerPage(); i++) {
        recipehandler.drawBackground(i);
        GlStateManager.translate(0, 65, 0);
    }
    GlStateManager.popMatrix();
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:18,代码来源:GuiRecipe.java


示例8: renderMap

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
@Override
public void renderMap(ItemStack stack, @Nullable MapData data, boolean inFrame) {
    if (inFrame) {
        TextureUtils.changeTexture("textures/map/map_background.png");
        GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
        GlStateManager.scale(0.0078125F, 0.0078125F, 0.0078125F);
        GlStateManager.translate(-64.0F, -64.0F, 0.0F);
        GlStateManager.translate(0.0F, 0.0F, -1.0F);
        if (data != null) {
            Minecraft.getMinecraft().entityRenderer.getMapItemRenderer().renderMap(data, inFrame);
        }
    } else {
        GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
        GlStateManager.scale(0.38F, 0.38F, 0.38F);
        GlStateManager.disableLighting();
        TextureUtils.changeTexture("textures/map/map_background.png");
        Tessellator tessellator = Tessellator.getInstance();
        VertexBuffer vertexbuffer = tessellator.getBuffer();
        GlStateManager.translate(-0.5F, -0.5F, 0.0F);
        GlStateManager.scale(0.0078125F, 0.0078125F, 0.0078125F);
        vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
        vertexbuffer.pos(-7.0D, 135.0D, 0.0D).tex(0.0D, 1.0D).endVertex();
        vertexbuffer.pos(135.0D, 135.0D, 0.0D).tex(1.0D, 1.0D).endVertex();
        vertexbuffer.pos(135.0D, -7.0D, 0.0D).tex(1.0D, 0.0D).endVertex();
        vertexbuffer.pos(-7.0D, -7.0D, 0.0D).tex(0.0D, 0.0D).endVertex();
        tessellator.draw();
        if (data != null) {
            Minecraft.getMinecraft().entityRenderer.getMapItemRenderer().renderMap(data, inFrame);
        }
    }
    render(stack, data, inFrame);
}
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:34,代码来源:WirelessMapRenderer.java


示例9: postRegisterIcons

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
public static void postRegisterIcons() {
    TextureAtlasSprite obsidian = TextureUtils.getBlockTexture("obsidian");

    model_icont = new MultiIconTransformation(base, blaze, obsidian);
    base_icont[0] = new MultiIconTransformation(base, off, base, base, base, base);
    base_icont[1] = new MultiIconTransformation(base, on, base, base, base, base);
}
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:8,代码来源:RenderWireless.java


示例10: drawArrow

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
private void drawArrow(int x, int y, int colour)
{
    TextureUtils.changeTexture("wrcbe:textures/gui/arrow.png");
    
    new ColourARGB(colour).glColour();
    Tessellator t = Tessellator.getInstance();
    VertexBuffer buffer = t.getBuffer();
    buffer.begin(7, DefaultVertexFormats.POSITION_TEX);
    buffer.pos(x + 0, y + 8, zLevel).tex( arrowdirection * 0.25, 1).endVertex();
    buffer.pos(x + 8, y + 8, zLevel).tex( (arrowdirection + 1) * 0.25, 1).endVertex();
    buffer.pos(x + 8, y + 0, zLevel).tex( (arrowdirection + 1) * 0.25, 0).endVertex();
    buffer.pos(x + 0, y + 0, zLevel).tex( arrowdirection * 0.25, 0).endVertex();
    t.draw();
}
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:15,代码来源:GuiButtonArrow.java


示例11: drawBackground

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
@Override
public void drawBackground() {
    if (largeGui) {
        TextureUtils.changeTexture("wrcbe:textures/gui/wirelessLarge.png");
    } else
        TextureUtils.changeTexture("wrcbe:textures/gui/wirelessSmall.png");
    GlStateManager.color(1, 1, 1, 1);
    drawTexturedModalRect(0, 0, 0, 0, xSize, ySize);
}
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:10,代码来源:GuiRedstoneWireless.java


示例12: preInit

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
@Override
public void preInit(FMLPreInitializationEvent e) {
	super.preInit(e);
	TextureUtils.addIconRegister(new DankTextures());
	DankNullPanelRenderer.initialize();
	ModBlocks.preInitModels();
	ModItems.preInitModels();
	ModCreativeTab.init();
}
 
开发者ID:p455w0rd,项目名称:DankNull,代码行数:10,代码来源:ClientProxy.java


示例13: preInit

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
@Override
public void preInit() {
    super.preInit();
    TextureUtils.addIconRegister(EnderPouchBakery.INSTANCE);
    ModBlocks.registerModels();
    ModItems.registerModels();
    RenderTileEnderTank.loadModel();
}
 
开发者ID:TheCBProject,项目名称:EnderStorage,代码行数:9,代码来源:ProxyClient.java


示例14: renderChest

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
public static void renderChest(int rotation, Frequency freq, double x, double y, double z, int offset, float lidAngle) {
    TileEntityRendererDispatcher info = TileEntityRendererDispatcher.instance;
    CCRenderState ccrs = CCRenderState.instance();
    ccrs.reset();

    renderEndPortal.render(x, y, z, 0, info.entityX, info.entityY, info.entityZ, info.renderEngine);
    GlStateManager.color(1, 1, 1, 1);

    TextureUtils.changeTexture("enderstorage:textures/enderchest.png");
    GlStateManager.pushMatrix();
    GlStateManager.enableRescaleNormal();
    GlStateManager.color(1, 1, 1, 1);
    GlStateManager.translate(x, y + 1.0, z + 1.0F);
    GlStateManager.scale(1.0F, -1F, -1F);
    GlStateManager.translate(0.5F, 0.5F, 0.5F);
    GlStateManager.rotate(rotation * 90, 0.0F, 1.0F, 0.0F);
    GlStateManager.translate(-0.5F, -0.5F, -0.5F);
    model.chestLid.rotateAngleX = lidAngle;
    model.render(freq.hasOwner());
    GlStateManager.popMatrix();

    GlStateManager.pushMatrix();
    GlStateManager.translate(x, y, z);
    renderButtons(freq, rotation, lidAngle);
    GlStateManager.popMatrix();

    double time = ClientUtils.getRenderTime() + offset;
    Matrix4 pearlMat = RenderUtils.getMatrix(new Vector3(x + 0.5, y + 0.2 + lidAngle * -0.5 + RenderUtils.getPearlBob(time), z + 0.5), new Rotation(time / 3, new Vector3(0, 1, 0)), 0.04);

    GlStateManager.disableLighting();
    TextureUtils.changeTexture("enderstorage:textures/hedronmap.png");
    GlStateManager.pushMatrix();

    ccrs.startDrawing(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    CCModelLibrary.icosahedron7.render(ccrs, pearlMat);
    ccrs.draw();
    GlStateManager.popMatrix();
    GlStateManager.enableLighting();
}
 
开发者ID:TheCBProject,项目名称:EnderStorage,代码行数:40,代码来源:RenderTileEnderChest.java


示例15: renderButtons

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
private static void renderButtons(Frequency freq, int rot, double lidAngle) {
    TextureUtils.changeTexture("enderstorage:textures/buttons.png");

    drawButton(0, freq.getLeft().getWoolMeta(), rot, lidAngle);
    drawButton(1, freq.getMiddle().getWoolMeta(), rot, lidAngle);
    drawButton(2, freq.getRight().getWoolMeta(), rot, lidAngle);
}
 
开发者ID:TheCBProject,项目名称:EnderStorage,代码行数:8,代码来源:RenderTileEnderChest.java


示例16: renderTank

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
public static void renderTank(CCRenderState ccrs, int rotation, float valve, Frequency freq, double x, double y, double z, int offset) {
    ccrs.reset();
    TileEntityRendererDispatcher info = TileEntityRendererDispatcher.instance;
    renderEndPortal.render(x, y, z, 0, info.entityX, info.entityY, info.entityZ, info.renderEngine);
    GlStateManager.color(1, 1, 1, 1);

    GlStateManager.pushMatrix();
    GlStateManager.translate(x + 0.5, y, z + 0.5);
    GlStateManager.rotate(-90 * (rotation + 2), 0, 1, 0);

    TextureUtils.changeTexture("enderstorage:textures/endertank.png");
    ccrs.startDrawing(4, POSITION_TEX_COLOR_NORMAL);
    tankModel.render(ccrs);
    valveModel.render(ccrs, new Rotation(valve, new Vector3(0, 0, 1)).at(new Vector3(0, 0.4165, 0)), new UVTranslation(0, freq.hasOwner() ? 13 / 64D : 0));
    ccrs.draw();

    TextureUtils.changeTexture("enderstorage:textures/buttons.png");
    ccrs.startDrawing(7, POSITION_TEX_COLOR_NORMAL);
    EnumColour[] colours = freq.toArray();
    for (int i = 0; i < 3; i++) {
        buttons[i].render(ccrs, new UVTranslation(0.25 * (colours[i].getWoolMeta() % 4), 0.25 * (colours[i].getWoolMeta() / 4)));
    }
    ccrs.draw();
    GlStateManager.popMatrix();

    double time = ClientUtils.getRenderTime() + offset;
    Matrix4 pearlMat = RenderUtils.getMatrix(new Vector3(x + 0.5, y + 0.45 + RenderUtils.getPearlBob(time) * 2, z + 0.5), new Rotation(time / 3, new Vector3(0, 1, 0)), 0.04);

    GlStateManager.disableLighting();
    TextureUtils.changeTexture("enderstorage:textures/hedronmap.png");
    ccrs.startDrawing(4, POSITION_TEX_COLOR_NORMAL);
    CCModelLibrary.icosahedron4.render(ccrs, pearlMat);
    ccrs.draw();
    GlStateManager.enableLighting();
    ccrs.reset();
}
 
开发者ID:TheCBProject,项目名称:EnderStorage,代码行数:37,代码来源:RenderTileEnderTank.java


示例17: getIcon

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
public TextureAtlasSprite getIcon(String key, TextureMap textureMap) {
    int img = map.get(key).img;
    String iconName = "QBModel" + hashCode() + "_img";
    TextureAtlasSprite icon = textureMap.getTextureExtry(iconName);
    if (icon != null) {
        return icon;
    }

    return TextureUtils.getTextureSpecial(textureMap, iconName).addTexture(new TextureDataHolder(images.get(img)));
}
 
开发者ID:TheCBProject,项目名称:CodeChickenLib,代码行数:11,代码来源:QBImporter.java


示例18: CustomGradient

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
public CustomGradient(ResourceLocation textureFile) {
    BufferedImage img = TextureUtils.loadBufferedImage(textureFile);
    if (img == null) {
        throw new RuntimeException("File not found: " + textureFile.toString());
    }

    int[] data = new int[img.getWidth()];
    img.getRGB(0, 0, img.getWidth(), 1, data, 0, img.getWidth());
    gradient = new int[img.getWidth()];
    for (int i = 0; i < data.length; i++) {
        gradient[i] = (data[i] << 8) | (((data[i]) >> 24) & 0xFF);
    }
}
 
开发者ID:TheCBProject,项目名称:CodeChickenLib,代码行数:14,代码来源:CustomGradient.java


示例19: preFluidRender

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
/**
 * Disables lighting, enables blending and changes to the blocks texture
 */
public static void preFluidRender() {
    GlStateManager.disableLighting();
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    TextureUtils.bindBlockTexture();
}
 
开发者ID:TheCBProject,项目名称:CodeChickenLib,代码行数:10,代码来源:RenderUtils.java


示例20: init

import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
public static void init() {
    if (!initialized) {
        Minecraft mc = Minecraft.getMinecraft();
        BlockRendererDispatcher parentDispatcher = mc.getBlockRendererDispatcher();
        CCBlockRendererDispatcher newDispatcher = new CCBlockRendererDispatcher(parentDispatcher, mc.getBlockColors());

        ObfMapping mapping = new ObfMapping("net/minecraft/client/Minecraft", "field_175618_aM");
        ReflectionManager.setField(mapping, mc, newDispatcher);

        TextureUtils.addIconRegister(newDispatcher);

        initialized = true;
    }
}
 
开发者ID:TheCBProject,项目名称:CodeChickenLib,代码行数:15,代码来源:BlockRenderingRegistry.java



注:本文中的codechicken.lib.texture.TextureUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OkHttpOAuthConsumer类代码示例发布时间:2022-05-22
下一篇:
Java ConstructorDeclaration类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap