Emax
-
Posts
8 -
Joined
-
Last visited
Posts posted by Emax
-
-
Hi, i'm trying to make a camouflage block with a TileEntitySpecialRenderer
This is the code (copied from http://www.minecraftforge.net/forum/index.php?topic=11397.msg59091#msg59091, just for an experiment) :
@Override public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) { if (tileEntity instanceof MyTileEntity) { Block block = Blocks.dirt; // i just trying dirt if (block != null) { RenderHelper.disableStandardItemLighting(); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glEnable(GL11.GL_BLEND); if (Minecraft.isAmbientOcclusionEnabled()) { GL11.glShadeModel(GL11.GL_SMOOTH); } else { GL11.glShadeModel(GL11.GL_FLAT); } GL11.glPushMatrix(); GL11.glTranslated(d0, d1, d2); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("minecraft", "textures/blocks/dirt.png")); // bind dirt Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); RenderBlocks renderBlocks = new RenderBlocks(tileEntity.getWorldObj()); tessellator.setTranslation(-te.xCoord, -te.yCoord, -te.zCoord); renderBlocks.renderBlockByRenderType(block, te.xCoord, te.yCoord, te.zCoord); tessellator.draw(); tessellator.setTranslation(0, 0, 0); GL11.glPopMatrix(); RenderHelper.enableStandardItemLighting(); } } }
This is what happens:
-
Hi, it's possible to transform a url (wich locate an image png) to a resource location?
i know how to download the image but i can't transform it to a resource location
-
This should work
public static void loadBind(BufferedImage image) { int[] pixels = new int[image.getWidth() * image.getHeight()]; image.getRGB(0, 0, image.getWidth(), image.getHeight(), pixels, 0, image.getWidth()); ByteBuffer buffer = BufferUtils.createByteBuffer(image.getWidth() * image.getHeight() * BYTES_PER_PIXEL); for (int y = 0; y < image.getHeight(); y++) { for (int x = 0; x < image.getWidth(); x++) { int pixel = pixels[y * image.getWidth() + x]; buffer.put((byte) ((pixel >> 16) & 0xFF)); buffer.put((byte) ((pixel >> & 0xFF)); buffer.put((byte) (pixel & 0xFF)); buffer.put((byte) ((pixel >> 24) & 0xFF)); } } glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, image.getWidth(), image.getHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, (ByteBuffer) buffer.flip()); }
-
The method sendPacket(C01PacketChatMessage) is undefined for the type NetworkManager
@SubscribeEvent public void onConnectedToServerEvent(ClientConnectedToServerEvent event) { event.manager.sendPacket(new C01PacketChatMessage("Hi!")); }
-
i want to send chat message to the server so all other players can read it like a normal message
Thank you
-
Hi, i'm developing a client mod i'm searching for a event that is called when the player join the server
and after he joins automatically send a chat message, i tried this code, but throw a NullPointerException when getting the player
@SubscribeEvent public void onConnectedToServerEvent(ClientConnectedToServerEvent event) { EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer; player.sendChatMessage("Hello!"); // <-- NullPointerException }
-
Hi, modders
Watch this screen:
Can you tell me why i get this error?
I create a new gui (extends GuiScreen) then
in the drawScreen i write this:
drawString(fontRendererObj, "why this is not working?", 0, 0, colorRed);
[1.7.10] TileEntitySpecialRenderer problem
in Modder Support
Posted
Sorry, and where i used them?
This is my frist look to a renderer and i need help