Jump to content

dev909

Members
  • Posts

    45
  • Joined

  • Last visited

Everything posted by dev909

  1. Fixed it. To anyone else with similar problems....seriously check your capitals. My problem was that I was giving my unlocalized name as "stainedStoneBricks". My Item models for the block was "stainedStonebricks". As larsgerrits said,
  2. Proxy Class: Registration class ItemBlock Thats the snippet of which blocks arn't working. From the crash file/testing in game, the models themselves are fine. Its just having problems with the inventory rendering.
  3. I normally don't post random files, but almost every other thread that I found related to this someone asked to see their jar file. Just trying to cut down on time. What exact code do you need to see? The customModelResourceLocations? The block declarations?
  4. Hey all, So after building my mod I'm missing just some of the models from the mod. I have searched around and it seems like the number one cause is mismatched filenames. I checked it and no avail. I even copy and pasted the entire assets folder into the jar and it still didn't work. Weirdly enough I'm only missing models from my stone brick blocks. I've posted the errors I got here: http://pastebin.com/zvhZWTPf I've also posted the jar here: https://drive.google.com/file/d/0B8m1DG4ghVbcZmZnZGN4Qy1kbzg/view?usp=sharing
  5. Sorry for the wait, I've been pretty busy over the last few weeks and kinda forgot about Minecraft. Anyways, I saw a tutorial somewhere online that included the metadata.
  6. I don't really understand where I should put World#isRemote. Should it be placed just after where I check the block instance? After I get the TE instance? After I check the NBT compound? Only around the code where I handle the TE? I just tried after getting the NBT tag, and I got the same result I had earlier where the changes would not occur right away for both players, but they do update at the same time. I'll post my TE class (sigh ): TE.class
  7. Ok so I now got: Block block = worldIn.getBlockState(pos).getBlock(); //Check block against target blocks if (block instanceof CBlock) { TileEntity te = worldIn.getTileEntity(pos); if (te instanceof CBlock_TE) { CBlock_TE tile = (CBlock_TE) te; NBTTagCompound nbt = stack.getTagCompound(); if (nbt != null && nbt.hasKey("rgb")) { int[] rgb = nbt.getIntArray("rgb"); tile.setColor(rgb[0], rgb[1], rgb[2]); worldIn.markAndNotifyBlock(pos, worldIn.getChunkFromBlockCoords(pos), block.getDefaultState(), block.getDefaultState(), 3); stack.damageItem(1, playerIn); return true; } else { return false; } } } Same thing as the original problem. Updates instantly for one player, but the other is delayed...
  8. I didn't know what the flags were, so I just put a 0 there. Is there a list of flags somewhere?
  9. And World#markAndNotifyBlock does not work. I have used in by itself and with markBlockForUpdate/markDirty.
  10. So would something like this do? Block block = worldIn.getBlockState(pos).getBlock(); //Check block against target blocks if (block instanceof CBlock) { TileEntity te = worldIn.getTileEntity(pos); if (te instanceof CBlock_TE) { CBlock_TE tile = (CBlock_TE) te; NBTTagCompound nbt = stack.getTagCompound(); if (nbt != null && nbt.hasKey("rgb")) { if (!worldIn.isRemote) { int[] rgb = nbt.getIntArray("rgb"); tile.setColor(rgb[0], rgb[1], rgb[2]); tile.getWorld().markBlockForUpdate(pos); tile.markDirty(); stack.damageItem(1, playerIn); return true; } } else { return false; } } } and for World#markAndNotifyblock....the last param is int flags. What are the flags I could use? EDIT: Nevermind it doesn't. I tried a couple different ways to place world.isremote in the code and every way doesn't work. The closest thing I got was that both test clients updated at the same time...but there was still a huge delay before the update occured. Also from reading into world.isremote, if isremote is false, then it means dedicated server right? If its true then its a 'combined client'? To get it to work on both sides, wouldn't I have to make two clauses, one for dedicated and one for combined? But they would both have to be the same code in order to work correctly; as in in the combined clause, in order for it to work the same in single player and lan, wouldn't the code have to be the same as the dedicated clause? Because it works fine for single player, but when opened to lan the game world should still be combined (isremote true)? And when in lan (combined) the update delay still occurs so I need to use the dedicated server clause code to fix it? Does anyone get what I mean? Or did I just completely overthink and confuse myself (and possibly others)? lol
  11. I have a TE that, when in single player, works perfectly. Such as that I click the block, logic happens and the appearance changes instantly. I thought that was it for the TE. When I complied a test mod for my brother to try with me, we noticed that whenever one of us click on the TE block, the changes occur some seconds later. The change occurs instantly after the other player (the one who did not click the block) updates the chunk by destroying/placing another block nearby. Now I know to force TE updates that I need to use TE.getWorld().markBlockforUpdate() wheverever I want the update to occur. For good measures I place markDirty() beneath that too. In my TE class, I have both getDescriptionPacket() and onDataPacket() defined. As far as I read, those two methods would allow for updates across the server and all the clients. I have only one field in the NBT (intArray) and I need the entire field, so again from reading about, it seems that getDescriptionPacket()/ondataPacket() is what I need. Relevant code: ItemPaintbrush.class TE.class I mean shouldn't this work? Item forces an update, which calls getDescriptionPacket() which sends out to clients that receive it through onDataPacket()?
  12. Ah. I did. In a few classes actually. Weird, I don't remember actually importing it. Oh well, I got it fixed now. Thanks alot!
  13. I thought it was weird too. But as far as I remember.....I didn't use it. I thought it was just some random underlaying forge class
  14. Well if you clicked on this thread then most likely you know what the error is about. I do not. I have googled around and it almost seems like for every thread I found, they was a different unique-ish solution. Here's the crash report: File structure within the jar file: jar/net/dev909/colorama/proxy jar/net/dev909/colorama/data jar/net/dev909/colorama/data/utils jar/net/dev909/colorama/data/tileentities jar/net/dev909/colorama/data/items jar/net/dev909/colorama/data/blocks jar/assets/colorama/textures jar/assets/colorama/models jar/assets/colorama/lang jar/assets/colorama/blockstates I don't understand what's happening...
  15. Ahhhhhhhhhhhhhhhhhhhhhhhhhhhh I forgot to look into the itemblock...oops heheh Yeah I got it fixed now. Didn't realize that for some reason my ItemBlock#getUnlocalizedName(ItemStack) was returning only the integer value of the blockstate, and not calling the block's actual getUnlocalizedName(). Thanks alot!
  16. So I have a couple blocks in my mod that have different properties. One block for example, uses PropertyEnum. In my lang file, tile.blockname.enum_name.name works. Another block though uses PropertyInteger. When I try to set a name like tile.blockname.integer_value.name it does not work. I checked through vanilla code at blocks like anvil, cactus, cake, etc, and most of them just uses the format tile.blockname.name, without specifying the integer value. This doesn't work for me either. So how do blocks with PropertyIntegers work for lang files? One thing I noticed is that in game, the PropertyInteger block's name is not in the format of tile.blockname.name. It's in the format of modID:blockname[PropertyInteger_name=integer_value].name. I think this is slightly weird. Also I tried using modID:blockname[PropertyInteger_name=integer_value].name and a few slight variations to see if they worked but nothing did work.
  17. I have a custom item which i want to apply damage to when i click a custom block. The whole point to it is that after clicking a block, it takes one more damage until its damage is at 0 and must click another block for it to "refill" the damage before being used again. In the items constructor i set the max damage to 16. In the items use method, after all other logic is done, i call the items set damage method and set it as 1 lower than what it currently is. Also when i click on another certain block im calling the set damage method to the items max damage, as in the item gets fully repaired (without using anvils). In game this doesnt work, and no damage bar is shown on the item. I cannot post my code as im not home on my computer. So basically the question is how do i allow an item to lower its damage when clicked on a certain block, and how can the items damage "refill" after clicking another block. Or in better terms, how does minecraft handle item damage to items that are not considered tools?
  18. Method is onItemUse(), and it works perfectly, thanks! As a side query, is there any benefit of having the original code in the blocks use method and the sneaking code in the items use method, compared to having all the code in the items use method? Besides for having cleaner looking code?
  19. I have an item and block that interact with each other just fine. I want to add a little bit more functionality by giving the item another 'mode' aka change behavior if the player is sneaking. So I added an if else block into my code to see if player is sneaking, and then do stuff. However in game my debug code will not fire if I'm sneaking and clicking on the block with the item. When I switch to an empty hand, the debug code fires and then it crashes (because the clause with the logic for sneaking is supposed to be using a certain item, not an empty hand). So this is making me wonder if it is possible to right click a block, while sneaking, with a specific item? All code is done within the block's onBlockActivated() method.
  20. I read about this not too long ago. I believe its not technically fired twice, its only being printed teice; once for client and once for server. If you read the full line of the console it will have a client or server tag in front. Shouldnt really be a big deal but if you want it to print once you have to add @sideOnly before the method I think...
  21. Ah, works now. Thank you so much! Out of curiosity the missing closing tag you edited about...is that something I should know for nbt, or is it just something that was missing like /code] in your post?
  22. Right...forgot about that.. Here's the relevant classes. The approach is to use an int array. Code flow is paintcan: set paintbrush color -> block: get color from paintbrush -> tileentity: get color from block, update -> block: render new color. COBlock.java COBlock_TE.java COBlockPaintcan.java
  23. Sorry for dragging up an old thread, but I haven't really had much time to code within the last couple months or so. Anyways I got a tile entity working for what I need, such as that I can right click a block and change its color in real time. Yay! I'm using just one int variable in the TE (color) and for the nbt compound and it works great. Blocks get updated right away with the right color, and only blocks that are clicked. However if I want to expand functionality from just one color, to three values (as in red, green, and blue variables) I get problems. I have tried two different methods that are not really that different from each other. I tried created an int array in the TE, and use int array for the nbt data, and I have tried storing three ints in the nbt data. I have updated the relevant classes for both approaches. No matter which one I choose, whenever I'm in game, if I place multiple blocks down, and right click just ONE, all the blocks get updated. Almost as if the block is acting as a singleton again and not having their own separate entities. Any clues?
  24. Hello possible saviors, I've been looking all over the forum, google, and src code for an answer but now I'm here. Ok here's what I'm trying to do: I want to be able to right click a block and render a new color on the block. So far I found two ways to possibly do this. The first way I found the method Block.recolorBlock(), which I think is the best way to go as I'm hoping that it will allow me to color per side (as its arg suggests) and that I can hopefully do it on any block. The second way was to create a custom block, override the color methods (getBlockColor(), getRenderColor(), colorMultiplier()), create a custom model that allows tinting (much like grass), and then when right click, of course change color. Preferably I would rather be able to set a custom color instead of using an enum for the recolorBlock() arg. I tried both ways and nothing has worked so far. Here's the codes: Method 1 (recolorBlock()): Method 2 (Custom blocks):
  25. Where would the config folder be for testing in eclipse? Somewhere in the eclipse folder?
×
×
  • Create New...

Important Information

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