Jump to content

lexwebb

Members
  • Posts

    56
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am not quite new now!

lexwebb's Achievements

Stone Miner

Stone Miner (3/8)

2

Reputation

  1. That's pretty cool . I was going to do something pretty similar, but then i sas iChuns Sync mod and thought it would be freaking cool if the item were to build in front of you, which this will! The overall aim is to have it build pixel by pixel into the full item.
  2. Well, i found out a better way of doing it, i am now using a single white texture and am coloring each pixel using glColor4d. This, quite handily takes the alpha values from my textures, so now all i have to do is literally plug the texture in and it renders . Thanks for your help Draco!
  3. I'm trying to render 16*16 individual cube models with different textures all at once, that's 256 texture sets... This is causing me horrendous amounts of lag, ie. 3FPS when i usually get 150+. I cant quite work out why its taking SO MUCH time to reset the textures each time. for(int xPos = 0; xPos < 16; xPos++){ for(int yPos = 0; yPos < 16; yPos++){ GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); Opticraft.textureLoader.loadTexture(imageList[xPos][yPos]); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GL11.glScalef(0.5f, 0.5f, 0.5f); GL11.glTranslatef(0.1f * xPos, 0.1f * yPos, 0.0f); cModel.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } } I've a custom texture loader that borrows some inner functions from Minecraft TextureUtil's in my TextureLoader: public void loadTexture(BufferedImage bufferedimage){ try { boolean flag = false; boolean flag1 = false; TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, flag, flag1); if (inputstream != null) { inputstream.close(); } } catch (IOException ex){ ex.printStackTrace(); } } This basically bypasses the Resource Location setting, so if anything, should be quicker than setting from resourceLocation. Is this a really stupid way of doing things? There are a few different ways i can do what i'm trying to do, but this would be my preferred.
  4. Because he doesn't texture the blocks, he only textures the full biped. + he's using skins, not item textures.
  5. Well i'm basically making a 3D printer, i need direct access to the .png's to be able to get each pixel of the images colour, which will be used to create a dynamic texture for a model that represents one pixel. These pixel blocks will be slowly built up by the printer, Similar to the Sync mod builds its player modes, except i want mine to be coloured in relation to the item being printed. I don't want to link directly through to assets, as i will have to make a long list containing the data of which .png links to which Item, and if I want to dynamically add mod items, that isn't going to work.
  6. I've had VERY simillar issues with trying to get transparent textures working on my tileEntity's. I've been looking into this but haven't found anything yet, I'm going to keep an eye out on this thread in case you find a solution, of course ill post what i've done if i get it to work
  7. yes thanks that does allow me to get the icon. My real need is to get a direct path to the .png file, do you know how i can get that from an Icon?
  8. Is it possible to get the Resource I.e texture of any item without making a specific reference inside the class? Preferably i'd need to be able to get the resource or ResourceLocation of any item, be it vanilla or a mod item. If i cannot do this, is there an easy way to get the associated .png of an Item. I've tried looking around in the RenderManager but haven't had much luck.
  9. I need to be able to sync an item selected in the clients GUI to an ItemStack inside my TileEntity. I have created a packet sending method inside my Container: public void sendSelectedItemPacket(){ ByteArrayOutputStream bos = new ByteArrayOutputStream(; DataOutputStream outputStream = new DataOutputStream(bos); try { outputStream.writeUTF("ItemSelect"); outputStream.write(tile_entity.xCoord); outputStream.write(tile_entity.yCoord); outputStream.write(tile_entity.zCoord); NBTTagCompound par1NBTTagCompound = new NBTTagCompound(); par1NBTTagCompound = selectedItem.writeToNBT(par1NBTTagCompound); String temp = par1NBTTagCompound.getName(); byte[] itemStackByte = par1NBTTagCompound.getByteArray(temp); outputStream.writeUTF(par1NBTTagCompound.getName()); outputStream.writeInt(itemStackByte.length); outputStream.write(itemStackByte); } catch (Exception ex) { ex.printStackTrace(); } Packet250CustomPayload packet = new Packet250CustomPayload(); packet.channel = (ModInfo.CHANNEL + "GuiSync"); packet.data = bos.toByteArray(); packet.length = bos.size(); PacketDispatcher.sendPacketToServer(packet); } This should (i hope) encode my selected items data to an NBTTag then byte array and send it through. I'm then re-making the item on the server using this method: private void handleItemSelectPacket(Packet250CustomPayload payload) { DataInputStream data = new DataInputStream(new ByteArrayInputStream(payload.data)); try { String temp = data.readUTF(); int byteLength = data.readInt(); byte[] itemStackByte = new byte[byteLength]; int x = data.readInt(); int y = data.readInt(); int z = data.readInt(); String compundName = data.readUTF(); data.read(itemStackByte); NBTTagCompound par1NBTTagCompound = new NBTTagCompound(); par1NBTTagCompound.setByteArray(compundName, itemStackByte); ItemStack iStack = ItemStack.loadItemStackFromNBT(par1NBTTagCompound); // MinecraftServer.getServer().get } catch (IOException e) { e.printStackTrace(); return; } } As you can probably see i'm not doing anything with the data i receive, as i cannot work out how to get a reference to the world > tileEntity from the data i receive in the packet. How would i go about getting that reference, or if there is an entirely better way of doing this then please let me know
  10. Descriptive comment for isBlockIndirectlyGettingPowered() is: 'Used to see if one of the blocks next to you or your block is getting power from a neighboring block. Used by items like TNT or Doors so they don't have redstone going straight into them. Args: x, y, z.' Your block is probably getting indirectly powered by the ones underneath them. You could try checking in the repeater class for how it detects its direct power.
  11. Awesome it works Thanks! The only thing i'm having issues with now is that it seems to be randomly rotated each time the game starts again. I'm setting the age to 0 every time so i'm not to sure what its about.
  12. Ah awesome thanks. Would you mind explaining where you are getting 'es.rotation' from, as i cannot seem to find a reference to it anywhere, and passing an arbitrary value in its place just seems to make the item spin uncontrollably.
  13. So i'm making a 3D printer block, so as you can imagine ill be needing to render the item i'm printing on the printing bed of the machine. I've experimented calling an ItemRenderer with bad results. Whats the best way to render an item like this in world? Would it be best to use an ItemEntity and somehow stop the rotation and make it un-pickupable? Or is there some way i can piggyback the ItemRenderer for an item as render it in my TileEntitySpecialRenderer?
  14. How large is the amount of data you will need to be storing for your leveling system? If you are having multiple abilities with different levels (I.e lots pf data per player) it would probably wise to integrate the server side of your Mod with a database system. E.g MySql. Otherwise, you could write a configuration file per player to a folder in the mods directory, which would be in a standard format and would simply store your player level data that way. There is also a handy tutorial i found for adding extra data to a player. E.g custom levels. this tutorial uses mana as an example, but i'm sure you could adapt it to your needs. (Post 2) http://www.minecraftforum.net/topic/1952901-eventhandler-and-iextendedentityproperties/http://www.minecraftforum.net/topic/1952901-eventhandler-and-iextendedentityproperties/
×
×
  • Create New...

Important Information

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