本文整理汇总了Java中codechicken.lib.texture.TextureUtils类的典型用法代码示例。如果您正苦于以下问题:Java TextureUtils类的具体用法?Java TextureUtils怎么用?Java TextureUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextureUtils类属于codechicken.lib.texture包,在下文中一共展示了TextureUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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();
}
示例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();
}
示例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));
}
示例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;
}
}
示例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()));
}
}
示例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();
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例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();
}
示例13: preInit
import codechicken.lib.texture.TextureUtils; //导入依赖的package包/类
@Override
public void preInit() {
super.preInit();
TextureUtils.addIconRegister(EnderPouchBakery.INSTANCE);
ModBlocks.registerModels();
ModItems.registerModels();
RenderTileEnderTank.loadModel();
}
示例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();
}
示例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);
}