Jump to content

Alexiy

Forge Modder
  • Posts

    198
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Alexiy

  1. Send the coordinates where the block is placed, ID (and meta) to server and do setBlock in packet handler.
  2. If you set on client only, they will disappear.
  3. I couldn't identify the issue, now I use ISimpleBlockRenderingHandler instead.
  4. 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(); } }
  5. I can't look at the code now, but yes, use Scaled resolution - create one every time before rendering and use its getScaledWidth, getScaledHeight.
  6. Will using player.openGui instead of FMLNetworkHandler.openGui change anything?
  7. Did you override the onDataPacket and getDescriptionPacket methods in Tile entity?
  8. 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.
  9. In minecraft there is only one Block instance for each type. So you have to change metadata for your goal. Use world.setBlockMetadataWithNotify.
  10. Does your @Mod class have @NetworkMod annotation? If not, then it must.
  11. I had this thing some time ago. It's likely because of getting wrong side TileEntity. You have to show your IGuiHandler.
  12. Looks like... *puts on glasses* ... you are confused.
  13. How did you fix the no-sound?
  14. 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.
  15. Did you install "dev" version or not?
  16. 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); } }
  17. The GUI width and height are .xSize and .ySize.
  18. Use the .xSize and .ySize (width and height).
  19. You have to get EntityPlayerMP instance and use .inventory.setInventorySlotContents(slotNumber, itemStack).
  20. You can just look at buildcraft source and copy it. Or you can import their code and use it.
  21. As you said, it triggers stuff inside of onBlockActivated().
  22. 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.
  23. http://www.minecraftforge.net/wiki/Basic_Items
  24. How would you know which tile entity to get without coordinates?
  25. Why are using @EventHandler instead of @Init?
×
×
  • Create New...

Important Information

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