Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by andGarrett

  1. so, hypothetically, something like ForgeRegistries.ITEMS.getValue(new ResourceLocation("minecraft:polished_diorite")); done a hundred times isn't a problem? actually, now that I've gone through the code again, it isn't all that much.
  2. I would have to do it a LOT given my current code.
  3. lol, the "key" in "ForgeRegistries.ITEMS.getValue(key)" is the ResourceLocation I mentioned here: unfortunately for me, I didn't write my code in such a way as to work well with converting the registry names into resource locations. I would have to create new ResourceLocations too often to be considered efficient. I may need to rethink some of my code.
  4. how? I tried "ForgeRegistries.ITEMS", but I can't find a way to get an item by it's registry name. It's possible to get an item by it's resource location, but I would much rather get it by registry name as I have a lot of code already written using the registry names.
  5. slot.putStack(new ItemStack(???); I'm trying to create an ItemStack using itemRegistryNames. I want to use a list of itemRegistryNames to fill 12 inventory slots. I know how to set a slot to empty "slot.putStack(ItemStack.EMPTY);", but not how to actually create an itemStack to put in the slots. Please help.
  6. it's more complicated using itemstacks, and I prefer to write my own code for things when possible. oh well, guess I'll be doing a rewrite.
  7. I have a store block that has a screen for buying items. it will have a randomized list of items for sale. instead of using itemstacks, I am instead creating my own custom buttons that will have an image of whatever item is being sold in that slot. when clicked on, the button will spawn a popup that will allow the player to buy some of the item in question. to accomplish this, I'm creating a static list of all the resource locations for the item and block images. This can then be referenced instead of creating a new resource location each time the image is drawn like:minecraft.getTextureManager().bindTexture(new ResourceLocation("textures/item/gold_ingot.png"));. Is this what you meant by "End user perspective thing"?
  8. I need to create a static arraylist of all the resource locations of item and block images, but I don't know how. something like: for (String item: assets.minecraft.textures.item) { recourceList.add(new ResourceLocation(item)); } for (String block: assets.minecraft.textures.block) { recourceList.add(new ResourceLocation(block)); } clearly this is incorrect and wouldn't work. how might I do this correctly?
  9. here's a version of blit that makes the most sense to me and works perfectly for what I'm doing: blit( int xPos, // x position relative to the screen image below it (not the entire screen). int yPos, // y position relative to the screen image below it (not the entire screen). int blitOffset, // z position (blitOffSet) float textureX, // x position on the texture image to draw from float textureY, // y position on the texture image to draw from int imgSizeX, // x image size to display (like crop in PS) int imgSizeY, // y image size to display (like crop in PS) int scaleY, // y image size (will scale image to fit) int scalex) // x image size (will scale image to fit) it's still a little confusing to use the first time. if you have something like: blit(10, 10, 10, 0F, 0F, 64, 64, 64, 64); you will end up with an image that is 64x64 that contains the entire image scaled to fit 64x64 of you do something like: blit(10, 10, 10, 0F, 0F, 64, 64, 32, 32); you get an image that is 64x64 but that contains 4 copies of your image in a 2x2 grid that are all 32x32.
  10. this is currently for testing purposes. once I get things working would this not be acceptable for something that would change? would I need to create a non-static field to store the changing data? you mentioned other versions of blit in another post of mine, but I have been unable to figure out how they work.
  11. is there a way to scale with blit, or do I need to use something else? here's what I'm trying to scale: minecraft.getTextureManager().bindTexture(new ResourceLocation("textures/item/gold_ingot.png")); blit(10, 10, 0, 0, 256, 256); [SOLUTION]
  12. Thanks, I decided to write an inner class that does what you described in your first reply. I figured out a few things that make it much easier than I had originally thought.
  13. can there only be one active "screen" at any given time?
  14. I created my own popup window class that extends "Screen", but it seems to replace the original screen that spawns it. is it possible to have the popup on top of the original screen? I could do what you said about just drawing the popup over the main screen, but then I would have to find a way to disable all mouse click events on the main screen, and that seems tedious.
  15. I'm thinking about adding a popup window in one of my container screens. would I need to have a screen within a screen, and if so how?
  16. here is your first reply on this thread. you end the reply with "...". Correct me if I'm wrong, but in most contexts that would indicate annoyance or loosing ones patience. "Any way you want?", is like asking "isn't it obvious?", which does nothing to help while also being backhanded. so you intentionally asked a backhanded question ended with "..." to indicate annoyance. you typed all this out deliberately. to be fair, you are not the only one who does this kind of thing. I would not be typing all this out if it were the first time I saw something like this, and you were the only one. If you truly had no idea that you were being negative, then I'm sorry for all this. All I want is to learn, without stepping on any toes.
  17. are you kidding? when I don't understand something, I look through the associated methods and classes. That should be the first thing a person does. Then I experiment. Then I look online for an answer/explanation. finally I post here on the forums. half the time when I post on this forum I get negativity. I assumed it was because I wasn't being diligent enough in figuring things out on my own. I spend HOURS trying to get something to work before asking here because I don't want to annoy people like yourself. Why, you ask, am I looking through those methods? to not bother you. to not get the negativity. An impossible task it seems.
  18. I did. from my container screen: @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F); this.minecraft.getTextureManager().bindTexture(GUI); int relX = (this.width - this.xSize) / 2; int relY = (this.height - this.ySize) / 2; this.blit(relX, relY, 0, 0, this.xSize, this.ySize); } "GlStateManager" is 1300 lines of mostly obfuscated code. "this.minecraft.getTextureManager().bindTexture(GUI)" creates an "ITextureObject" within the Texture maneger. I'm not sure what an "ITextureObject" does, and, looking at the code, would take a lot of trial-and-error to figure out how to use if I'm even capable. after creating the ITextureObject, bindTexture() has the line "this.loadTexture(resource, itextureobject)". loadTexture() is pretty hard to understand just looking at the code. the next three lines revolve around "this.blit()", which leads me to more obfuscated code. There are many rabbit holes I could spend hours upon hours looking down. I've already spent a few hours looking for the answers myself as well as experimenting with the code. I was hoping someone on the forum might be able to either point me to an explanation or give a short one themselves.
  19. how exactly do I render the image though? I don't know how to render an image at all. I know how to draw strings with "this.font.drawString()", and I've tried "this.minecraft.getTextureManager().bindTexture();", but that seems incorrect.
  20. I mean what class and/or method is used to display moving images. I was having trouble finding the correct method.
  21. I'm writing my own scroll-bar slider class, and I was wondering, how would I render the slider on my container screen?
  22. why are some variables named things like "p_76131_0_"? is that a programing thing, a java thing, or a minecraft thing?
  23. If it's not to much trouble, could you or anyone who knows explain why this would be the preferred way to send such a packet?
  24. I think I figured it out: player.connection.netManager is the second parameter.
  25. I'm trying to Sync up a server-side player capability with a client-side player capability. I don't know what I should send the packet to. I tried the player but I don't know exactly how to use the "sendTo" method. I tried: MerchantcraftPacketHandler.channel.sendTo(new SyncBalancePacketToClient(b), ???, NetworkDirection.PLAY_TO_CLIENT); I have no idea how to work with NetworkManager (the second parameter), and I'm not even sure about "NetworkDirection.PLAY_TO_CLIENT".
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.