Jump to content

rinart73

Members
  • Posts

    51
  • Joined

  • Last visited

Everything posted by rinart73

  1. I'm trying to crate a small mod that uses Thaumcraft API. As you can see, it's not packed as jar file. I tried to archive it as jar and place in the libs category of my project. After that IntelliJ IDEA sees the thaumcraft package but no classes in it. I tried to add various 'compile' directives in the build.gradle file with no success. One of them actually messed up everything and IntelliJ didn't see any minecraft classes either. Please help. I searched but various tutorials only say what to do when you have a .jar file and Eclipse.
  2. How to achieve maximum performance with TESR if I'm going to make almost static blocks? In theory I need to make a lot of tile entities that are changing their view only on player interaction or when neighbor block changes. No animation on tick. Unfortunately I couldn't find a way to achieve my goal with usual json block models, because I need to deform block model by moving their vertices. And as I understand there was thing called ISBRH for 1.7.10 that was intended for custom but static models. It was removed in 1.8.
  3. For example I need to track down a sequence of events that happen with Player. Firstly he uses some item, then he is attacked by Skeleton and then he is in the water. Boom! Sequence is done, time to do some action. If he dies or relogs or world restarts, then sequence should be reset as well. Or if I just need to make some actions every X times when event happens. I don't really need this data to be saved, why should I make data files larger when I don't even use this data? So, I can return null instead of NBT Base Tag in serializeNBT?
  4. Basically I need to store a few values for Entities. I'm fine that this values will be reset to defaults on Entity death. And I don't want this values to be saved in files. The thing is, I must provide a Storage implementation to register Custom Capability. What should I do?
  5. At this point I already managed to get getActuallState to work (I said it a few posts above). So now getActualState method is called and the correct value is returned. But the model of block isn't changing until I'll force a block update. If I'll try to break block, it will emit particles with the correct texture. So the game just doesn't want to.. redraw block?
  6. Bump. Seriously, I have just one problem left. Anybody?
  7. UPD: I managed to get the game to call getActualState. Have no idea how. There is only one problem left. When I break blocks that don't see sky, they emit "no-sky" (dark) particles. And when I break blocks that're seeing sky, they emit "sees-sky" (white) particles. The only problem is that block that see sky are still having dark texture, that is weird. UPD: Ok, as I understand, there is no built-in system that detects that the game should re-render block that changed it's blockstate? I tried to push block with piston and it changed color. So in order to change just the model of block, I should trigger a full block update. It doesn't seem to be performance-wise thing. But since everybody's code works as intended (block model updates instantly) and mine is not, here is the code of my block's class. https://pastebin.com/pqracKUs
  8. No. And the thing is: If I'll remove this.setDefaultState(this.blockState.getBaseState().withProperty(SKY, false)); from the constructor, getActualState will be called by game. And the value can be false or true, but the block will ALWAYS look like the blockstate is always "true" for it. Also, there will be an ItemBlock with purple texture in CreativeTab. And it shouldn't be there. If I'll keep this line. There is only ItemBlock with metadata 0 (how it was intended to) and getActualState won't ever be called by the game. At this moment I just don't know why and how.
  9. Nothing happens, breakpoint is not hit. As I said, the game doesn't call it. Yes, I'm using Override annotation.
  10. I know that it's not set to true because if it will be set to true, I will see the other blockstate of the block, which has other texture. Also, I tried to log the value of ((World)worldIn).canBlockSeeSky(pos) every time this method is called. And it's not called during the game. So I'm expecting block to change it's appearance according to if it's exposed to sky or not and it just doesn't change it, becuase this method isn't called by the game.
  11. Nevermind, it was my mistake. I have other question now: Tutorial says: "If we want our block to have a property that is set not by metadata but by the surrounding blocks or other values, we have to override getActualState." @Override public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { return super.getActualState(state, worldIn, pos); } "This method allows us to modify the state which was calculated using the metadata. The calculated state is passed in as the argument "state". We can use .withProperty on this field to modify or add certain properties. For instance, we could add the property "sky" which is a boolean and true if the block has no other block above it." @Override public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) { return state.withProperty(SKY, ((World)worldIn).canBlockSeeSky(pos)); } So, if the block can see sky, it should have property SKY set to true. The thing is that it doesn't works. It seems that the game doesn't call getActuallState at all. If I'll move this code to the updateTick() event and will enable randomTicks, it works fine. But in the getActuallState it doesn't
  12. Is there any way to have block with blockstates, but have it as ItemBlock in only one blockstate? I mean, for example, I have a block that changes it's blockstate depending on the surrounding area. So it has 2 states: default blockstate and a blockstate when certain conditions are met. But I want to have only default blockstate as an ItemBlock. What do I need to change? Don't register ItemBlock for meta-s other than 0 in mesher? Or don't register other blockstates in ModelLoader? Or what? When I'm trying to change anything, everything just breaks and I say hi to purple textures.
  13. Well, I adapted 1.8 tutorial for blockstates and it kinda works. But as for the item part of the block - it's just purple block in player hands - for any state. And when I tried to use "ModelBakery.registerItemVariants", it's got even worse. Now it's flying in front of player and has text with the name of the block variant. I'm following tutorial, I have JSON models for every state in the "models/block" and "models/item" directories. I'm going to ask for a tutorial again, because nor current tutorial, nor game code (which is actually different from what I see in the tutorials in the internet - for example it lack the using of ModelBakery.registerItemVariants and that stuff for blocks like carpets) helps me.
  14. Does it breaks/can break anything if I register most of the stuff in preInit? Because it's much more comfortable then just splitting everything into SubscribeEvents.
  15. Yes, I did. Still whenever I'm trying to look at the minecraft code, IntelliJ Idea just decompiles it on it's own. I read this and actually can't understand, is there only one SubscribeEvent that is related to the blocks/item registering - registerBlocks? If not, why they're not in the Docs? And what's the difference between doing that stuff in preInit and using SubscribeEvents like registerBlocks?
  16. Thanks. Unfortunately Forge Docs are not really informative in terms of examples. It's a shame to admit, but I'm still fighting with ForgeGradle and IntelliJ IDEA to make them show me minecraft sources (not IntelliJ Idea decompiled code). And yes, I used 'setupDecompSpace' (or something like that) so I guess it should provide it. I'll try to look for info about TileEntity in the future. U.P.D: Found a problem. In 1.8 we can use something like this to register block: GameRegistry.registerBlock(someBlock = new SomeBlock("block_properties"), ItemBlockMeta.class, "block_properties"); It's hard to explain, just look at the tutorial please. ItemBlockMeta extends ItemBlock and helps to get an item of the block that has metadata. In 1.11.2, we don't have a way to specify that.
  17. I just need an example of using metadata. Something like in tutorial that I gave link to. Colors or directions + creative tab variants + saving them in item state (or something like that, I can't understand what is the purpose of ItemBlock code in the tutorial) And by the way, I don't understand how complex blocks like furnaces or modded super-crafting tables work. They need to save a lot of info for a specific block, but we only can use 4 bytes. Ok, I think there is a way to add an Inventory or crating grid to a block, but there are way more stuff that needs to be saved.
  18. Thanks for explaining that. As for specific questions, I can't ask. I just need a proper understandable example or tutorial. I can't ask about something if there is nothing I understood yet about this.
  19. So, if I understand correctly, saying in a more simple way, metadata is just a storage which is used specifically for block variants. So.. dye, block rotation e.t.c. For more complex data the usual class properties can be used. They just can't be used normally to affect the visual stats of the block in the world. I mean, as I understand, they can, but then you'll need to override drawing for this block or something like that. There is another question then. Is there any good tutorials for 1.11.2? Just simple block metadata that affects block variants. No terrifically big classes that are describing every aspect of the block and has other stuff. Currently I'm learning using this series of tutorials (good one, actually), but it's for 1.8. I have to edit some thing to get it work. It's not bad actually, the real problem is that in some tutorials (like that one that described metadata) author creates some sort of workaround or something. It probably should make coding easier. But it's not, for me, at least. So, please explain to me. I understand using of Enums I think, but the code that is related to ItemBlock and that stuff. Just.. a bunch of lines. And I had experience with programming before.
  20. Well, not really. I mean, I still can type in the server console. And IntelliJ will not 'focus' editor on the line with breakpoints (as some other IDE do). I don't know, if it's even should.
  21. Yes, this is a dumb question. I just can't understand. Yes, I googled it, no results, there were some ways to clear Idea cache, but it doesn't help. The thing is I'm trying to edit a ForgeGradle mod. I imported it in the IntelliJ Idea. It compiles, I'm working on it and it works in the game. Then I need to understand, what's wrong with my code. I place some breakpoints and run in the Debug mode. "Variables" is empty and I don't even sure that breakpoints are working. No, "Mute Breakpoints" is off. I'm writing this question here, because I think that IntelliJ just doesn't see something, because we're dealing with Minecraft and mods and not just regular Java application. Please help, I'm tired.
  22. No. Yes, C#, JavaScript. No There is NO up-to-date mods, which can help me! And I'm not a fully dumb, I finally found FontRenderer sources with SRG names, I compared it with patch file and translated changes with new variable names. But I've got NotFoundClass exception. Then I tried to use a patch file with minimal changes, just for test. Now it looks like: And what I got? NotFoundClass exception. Maybe it's a bug in the Forge?
  23. I just need normal font for Unicode non-latin character when scaling is below 1.0. Now it looks crappy and I can't read it. There is a bunch of mods for 1.7.10 and below (Better Fonts, Client Fix, Unicode Font Fixer) but I can't port them! Better Fonts allows to use ANY Windows font in the game. It uses patches.
  24. Unfortunately BytecodeViewer and other decompilers provide inaccurate result. And now I have "java.lang.NoClassDefFoundError: net/minecraft/client/gui/FontRenderer". Mod is trying to patch class FontRenderer. I checked, all changes are valid. So the problem is in inaccurate sources from decompilation.
×
×
  • Create New...

Important Information

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