Everything posted by Elrol_Arrowsend
-
[1.7.10] Having a GUI enable buttons depending on items in a players inventory
that is what I had done yet my attempts to make one have failed time and time again, I have tried this: ItemStack[] recipe = new ItemStack[]{new ItemStack(Items.apple, 2), new ItemStack(Items.leather, 3)}; for(int slots=0; slots < player.inventory.mainInventory.length; slots++){ for(int ingredients = 0; < recipe.length; recipe++){ if(player.inventory.mainInventory[slots] != null && player.inventory.mainInventory[slots].getItem().equals(recipe[ingredients].getItem()) && player.inventory.mainInventory[slots].stacksize >= recipe[ingredients].stacksize){ activateButton(): } } but it returns per item I cant get it to check if the player has x y and z before returning true, I have been working on this bit of code for like 2 days now, today I got the button to activate if the player had one item and the correct amount of that item, and if the recipes contained the same amount of items then I would just make multiple for loops one per item nestled inside of each other but the number of items per recipe change so that would be rather unreliable
-
[1.7.10] Having a GUI enable buttons depending on items in a players inventory
Hello, I am making a block that once you open its GUI it checks the players inventory for multiple itemstacks, and if the player has the item stacks and the minimum quantity of the items the GUI's button for a specific item is enabled to allow the player to click the button taking these items and returning the item to the players inventory. I have managed to get this to work with only one item stack, and when I was adding 2 item stacks I had to add another for loop to check all of the players itemStacks that are not null to see if they had both of the stacks. now I am trying to make a single method to check for if the player has all the items in a recipe which can have more then just 2 or 3 different items, is there a good way to check a players inventory for items and quantity, I know that the player.inventory.hasItem(item); will only return true if the player has the item, not checking for if the player has a minimum requirement of that item, even the player.inventory.hasItemStack(itemStack) which I thought would be what I wanted only checks for the items. I am using packets to check for the players inventory. if this is difficult to understand then think about it like I was trying to make the forge from Skyrim in minecraft. it has a similar feature, if the player has all the required items it will be lit up and allow you to craft it.
-
[1.7.10] Rendering a texture overlay on a block
Can you explain a bit more. How would this file help me?
-
[1.7.10] Rendering a texture overlay on a block
Hello. I am trying to make a block that will register two textures to make a double slab. The first texture will be the base block and the second render will be the top slab so that the final block looks like a double slab that uses two different slabs. I am having problems making a texture overlay. And i dont feel like adding 144 textures to the mod as that is a last resort if nothing else works. Any help is welcome.
-
[1.7.10] NBTTag data resets on rejoining world
Thanks. I got it working
-
[1.7.10] NBTTag data resets on rejoining world
Its thw file in his code that he is checking if the block is an instance of it. I still dont quite understand how i use this information. Do i call a method in one of these packet classes an have the packet be sent to the server. And then how would i get that string to set the name in the gui
-
[1.7.10] NBTTag data resets on rejoining world
What is the IMClPacketHandler. Its the only bit im missing
-
[1.7.10] NBTTag data resets on rejoining world
So. My entire code regadding nbt is not meeded anymore or do i use packets to send thw nbt to the server.
-
[1.7.10] NBTTag data resets on rejoining world
I know this. I said that was the only thing i saw yet i have no idea how to use packets to save the nbt to the server
-
[1.7.10] NBTTag data resets on rejoining world
the way that my code works: shift + right click on the blocks will open a gui where you can name the block (floor) right click on the block will show the teleport gui which shows each valid teleport destination as floor 1, floor 2, etc unless the floor is named, ie floor 1, floor 2, roof clicking on the button for the different floors will teleport the player to that location. all of this works the only problem is once i leave the world and rejoin the world the floors are no longer named properly. here are the majority of the code involved: TileEntityElevator: FloorSelectGUI Elevator: FloorNameingGUI
-
[1.7.10] NBTTag data resets on rejoining world
Im at work atm. And by named block i mean the name of the block in the custom gui i made to allow tp. I have nbt to set the 'dloor' name on each block. The blocks name is the same on all but the blocks floor name changes depend on what you name it in my custom naming gui. When i get off i will post code.
-
[1.7.10] NBTTag data resets on rejoining world
Alright so i got my block to open a gui and to set the name of the block correctly. Now when i relog the name is back to the default. I looked online and i read somethings about sending packets to the server. I have yet to see anything on nbt data packets of how to use them. Any help is welcome
-
1.7.10--determining if a block is solid
Thanks for that tip. Since it requires less argumentsbit would be easier to use. Thanks. And i love your zss mod
-
1.7.10--determining if a block is solid
Managed to get it to work running a test using if(world.getBlock(x,y,z).getCollisionBoundingBoxFromPool(world,x,y,z) == null){ //the block at x y z has no collision box }
-
1.7.10--determining if a block is solid
I am making a mod and in this mod when it checks to teleport the player it was checking if the blocks that the player would tp were air. It worked fine in vanilla but once railcraft was added in my modpack the residual heat were keeping the player from spawning since they were not air. I am trying to find a way to see if the blocks in the teleport destination are soild, meaning any block the player can not walk through. I have tried isSolidCube and isOpaqueCube and both allowed the player to teleport into these blocks. I want things like water and air like blocks to allow the player to to but chests and glass and other solid blicks to prevent the teleport
-
1.7.10-Setting a players starting worlds
Alright so I am looking to change the spawning location of the players when they create a new world before the world is loaded. I want them to spawn at or near 0, y, 0. Is there a way to do this before the player joins the world?
-
[1.7.10]Hqm in Eclipse for custom modpack with mod
Alright. So I am trying to make a modpack with a custom mod awell as making quests using hqm. I am trying to use HQM in the eclipse workspace so that i can add quests and what not while i work on modding my cusom mod around those quests. However. When i place HQM in the mods folder for my eclipse it crashes me every time with the collowing errors : crash report
-
[1.7.10] Configuration Comments not working
Thanks for the reply, I didnt think that in this case my entire code would be of much assistance, but I shall next time. Thanks for the assistance.
-
[1.7.10] Configuration Comments not working
Hey, I am having problems getting my config to add comments. i followed this tutorial: i used this: Property one = config.get(Configurations.CATEGORY_GENERAL, "test", 1); one.comment = "this is a comment"; int Test = one.getInt(); my config loads and it loads the "test" and has it set to a value of 1 but there is no comment and everything else works for it. has the method changed since 1.6.4 and/or is there a way to add a space inbetween the config values
-
[1.7.10]Custom Dimension that generates like the overworld
I managed to get stuff like stone and dirt and grass to generate, but I have 2 errors. 1) no ores or biome decorations at all and 2) the world is not generating the same as the overworld. here is my code: public Chunk provideChunk(int p_73154_1_, int p_73154_2_) { this.rand.setSeed((long)p_73154_1_ * 341873128712L + (long)p_73154_2_ * 132897987541L); Block[] ablock = new Block[65536]; byte[] abyte = new byte[65536]; this.func_147424_a(p_73154_1_, p_73154_2_, ablock); this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, p_73154_1_ * 16, p_73154_2_ * 16, 16, 16); this.replaceBlocksForBiome(p_73154_1_, p_73154_2_, ablock, abyte, this.biomesForGeneration); this.caveGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); this.ravineGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); if (this.mapFeaturesEnabled) { this.mineshaftGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); this.villageGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); this.strongholdGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); this.scatteredFeatureGenerator.func_151539_a(this, this.worldObj, p_73154_1_, p_73154_2_, ablock); } for(int i = 0; i < ablock.length; i++){ if(ablock[i] != null){ Block original = ablock[i]; Block temp = Mirror(ablock[i]); ablock[i] = temp; if(original != temp){ //System.out.println("Replaced " + original.getLocalizedName() + " with " + ablock[i].getLocalizedName()); }else{ //System.out.println("No Mirror Item Found For " + temp.getLocalizedName() + temp.getLocalizedName()); } } } Chunk chunk = new Chunk(this.worldObj, ablock, abyte, p_73154_1_, p_73154_2_); byte[] abyte1 = chunk.getBiomeArray(); for (int k = 0; k < abyte1.length; ++k) { abyte1[k] = (byte)this.biomesForGeneration[k].biomeID; } chunk.generateSkylightMap(); return chunk; } [/Code]
-
[1.7.10]Custom Dimension that generates like the overworld
I was testing something out, but when I just copy the entire file, change the bare minimum so that the code works, it generated the right world seed but the chunk seed is set with a random, and I cant find how to get a seed for the chunks. I can use this to get the chunk for the cords in the overworld: MinecraftServer server = MinecraftServer.getServer(); server.worldServerForDimension(0).getChunkFromChunkCoords(x, z); [/Code] that will give me the same chunk that is in the overworld at the same position as the chunk it is trying to generate in the Mirror dimension. I don't know where to go from there to get the chunk seed
-
[1.7.10]Custom Dimension that generates like the overworld
I figured out that I was not calling my ChunkProvider right, once I registered it properly I was able to see some of my blocks generate, but it no longer is generated like the overworld. I think that the chunk seed need to be the same, so how would I go about setting them to be the same
-
[1.7.10]Custom Dimension that generates like the overworld
I cant seem to find java.util.Map<K, V> however, I was wondering if there was a way to put the byte, into an int and have that set the metadata for a block so that I can run it in my code. is it possible to cast a byte to an int, and is there a thing like Block.setMetadata((int)byte)[/Code] the help I have gotten so excited from the help you have given me. It has really helped me out.
-
[1.7.10]Custom Dimension that generates like the overworld
I also came up with what I hope is a better way to test/mirror the blocks. I made another block list containing my mirror versions, and I changed the .mirror to look like this: public static boolean canBeMirrored(Block block){ for(int i=0; i > OriginalBlocks.length; i++){ if(block == OriginalBlocks[i]){ return true; } } return false; } public static Block mirror(Block original){ for(int i=0; i > OriginalBlocks.length; i++){ if(original == OriginalBlocks[i]){ return MirrorBlocks[i]; } } return original; } [/Code]
-
[1.7.10]Custom Dimension that generates like the overworld
I understand that, one last thing and I think I will be well on my way to getting everything added. How would I go about adding a check for the different woods for example, since the wood is dependent on the metadata, I guess I am asking how I would get a specific block with metadata into a Block[] I do thank you very much for all the assistance with my issue. Once I have my code working I will defiantly +1 you
IPS spam blocked by CleanTalk.