Jump to content

Alexiy

Forge Modder
  • Posts

    196
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Alexiy

  1. I couldn't identify the issue, now I use ISimpleBlockRenderingHandler instead.
  2. I have a Tile entity which sides can be "closed". When side is closed, it renders a rectangle at that side. But it doesn't render at certain angles, watch - http://www.youtube.com/watch?v=Lc0WRoUvs6c&feature=youtu.be. Renderer: public class HolderRenderer extends TileEntitySpecialRenderer { @SuppressWarnings("incomplete-switch") @Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { TileeMover mover=(TileeMover) tileentity; glPushMatrix(); glTranslated(x, y, z); glColor3f(0.6f, 0.2f, 0.8f); for(ForgeDirection direction:mover.closedSides) { glBegin(GL_QUADS); switch(direction) { case NORTH: glVertex3f(0, 0, 0.01f); glVertex3f(0, 1f, 0.01f); glVertex3f(1f, 1f,0.01f); glVertex3f(1f, 0,0.01f); glVertex3f(0, 0, 0.01f); glVertex3f(1f, 0,0.01f); glVertex3f(1f, 1f,0.01f); glVertex3f(0, 1f, 0.01f); glEnd();break; case EAST: glVertex3f(0.99f, 0, 0f); glVertex3f(0.99f, 1f, 0f); glVertex3f(0.99f, 1f,1f); glVertex3f(0.99f, 0,1f); glVertex3f(0.99f, 0, 0f); glVertex3f(0.99f, 0,1f); glVertex3f(0.99f, 1f,1f); glVertex3f(0.99f, 1f, 0f); glEnd();break; case WEST: glVertex3f(0.01f, 0, 0f); glVertex3f(0.01f, 0 ,1f); glVertex3f(0.01f, 1f,1f); glVertex3f(0.01f, 1f, 0f); glVertex3f(0.01f, 0, 0f); glVertex3f(0.01f, 1f, 0f); glVertex3f(0.01f, 1f,1f); glVertex3f(0.01f, 0 ,1f); glEnd();break; case SOUTH: glVertex3f(0, 0, 0.99f); glVertex3f(1, 0, 0.99f); glVertex3f(1f, 1,0.99f); glVertex3f(0, 1,0.99f); glVertex3f(0, 0, 0.99f); glVertex3f(0, 1,0.99f); glVertex3f(1f, 1,0.99f); glVertex3f(1, 0, 0.99f); glEnd();break; case DOWN: glVertex3f(0,0.01f, 0f); glVertex3f(1, 0.01f, 0f); glVertex3f(1f, 0.01f,1f); glVertex3f(0, 0.01f,1f); glVertex3f(0,0.01f, 0f); glVertex3f(0, 0.01f,1f); glVertex3f(1f, 0.01f,1f); glVertex3f(1, 0.01f, 0f); glEnd();break; case UP: glVertex3f(0,0.99f, 0f); glVertex3f(0, 0.99f,1f); glVertex3f(1f, 0.99f,1f); glVertex3f(1, 0.99f, 0f); glVertex3f(0,0.99f, 0f); glVertex3f(1, 0.99f, 0f); glVertex3f(1f, 0.99f,1f); glVertex3f(0, 0.99f,1f); glEnd();break; } } glPopMatrix(); } }
  3. I can't look at the code now, but yes, use Scaled resolution - create one every time before rendering and use its getScaledWidth, getScaledHeight.
  4. Will using player.openGui instead of FMLNetworkHandler.openGui change anything?
  5. Did you override the onDataPacket and getDescriptionPacket methods in Tile entity?
  6. One thing I found useful is if you have keybindings, it is better to prefix them with your mod name or alias. Because when there are many keybindings in controls list you have no idea what mod they come from since almost no mod prefixes them with its name.
  7. In minecraft there is only one Block instance for each type. So you have to change metadata for your goal. Use world.setBlockMetadataWithNotify.
  8. Does your @Mod class have @NetworkMod annotation? If not, then it must.
  9. I had this thing some time ago. It's likely because of getting wrong side TileEntity. You have to show your IGuiHandler.
  10. Looks like... *puts on glasses* ... you are confused.
  11. I didn't like the way how minecraft GUIs are written. Most people make GUI textures and align them with slots, buttons, etc. I decided to do it different way - I made it so Container's element positions are linked with GUI's element positions and I did textures only for slots. It resulted in fine minimalistic GUI which can be changed easier than original ones: As you know, GUIs have borders; when you click with an item outside its borders, it is dropped into world. Those lines are GUI's borders. Textures are drawn per each slot.
  12. Did you install "dev" version or not?
  13. I'm trying to make a Buildcraft addon. The buidcraft is in my project as a Jar. I have some classes that extend buidcraft classes. When I recompile, I get many errors: package finetechnology.buildcraftaddon; import org.lwjgl.opengl.GL11; import net.java.games.input.Keyboard; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.inventory.IInventory; import buildcraft.core.gui.BuildCraftContainer; import buildcraft.core.gui.GuiBuildCraft; import buildcraft.transport.TileGenericPipe; public class GUItextPipe extends GuiBuildCraft { public GUItextPipe(BuildCraftContainer container, IInventory inventory) { super(new ContainerTextPipe(0), inventory); // TODO Auto-generated constructor stub } String [] filters; byte yOffset=33; byte stringHeight=18; // PipeLogicText filter; byte xBetween=40; // GuiTextField addFilters[]=new gui; GuiTextField filter; String filterText; @Override public void initGui() { super.initGui(); String text="Add filter"; filter=new GuiTextField(fontRenderer,width/2-width/12,3,width/6,16); org.lwjgl.input.Keyboard.enableRepeatEvents(true); // GuiButton add=new GuiButton(0, xBetween,13, text.length(), stringHeight, tezt); for (byte side=0;side<6; side++) { String buttontext="Add here"; buttonList.add(new GuiButton(side,3+(width/6)*side,23,fontRenderer.getStringWidth(buttontext)+6,18,buttontext)); } } @Override public void drawScreen(int arg0, int arg1, float arg2) { super.drawScreen(arg0, arg1, arg2); filter.drawTextBox(); // filter. } @Override protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { this. drawVerticalLine(guiLeft,guiTop+ySize, guiTop, -9408400); drawVerticalLine(guiLeft+xSize,guiTop+ySize,guiTop,-9408400); drawHorizontalLine(guiLeft,guiLeft+xSize,guiTop, -9408400); } @Override protected void mouseClicked(int par1, int par2, int mouseButton) { super.mouseClicked(par1, par2, mouseButton); filter.mouseClicked(par1,par2,mouseButton); } @Override protected void keyTyped(char par1, int par2) { if(filter.textboxKeyTyped(par1,par2)) { filterText=filter.getText(); } } @Override public void onGuiClosed() { // TODO Auto-generated method stub super.onGuiClosed(); org.lwjgl.input.Keyboard.enableRepeatEvents(false); } }
  14. The GUI width and height are .xSize and .ySize.
  15. Use the .xSize and .ySize (width and height).
  16. You have to get EntityPlayerMP instance and use .inventory.setInventorySlotContents(slotNumber, itemStack).
  17. You can just look at buildcraft source and copy it. Or you can import their code and use it.
  18. As you said, it triggers stuff inside of onBlockActivated().
  19. Last time I checked, there is no way to modify the tooltip, because the list containg info is being created inside a method. But if you use NEI, it gives such possibility.
  20. http://www.minecraftforge.net/wiki/Basic_Items
  21. How would you know which tile entity to get without coordinates?
  22. Why are using @EventHandler instead of @Init?
  23. I'd like to have a method which would tell if some block has a GUI associated with. It would be very helpful for my mod.
  24. I don't want to open Eclipse now to answer your question, but yes there is. Search for "trace" or "raytrace".
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.