Jump to content

jabelar

Members
  • Posts

    3266
  • Joined

  • Last visited

  • Days Won

    39

Everything posted by jabelar

  1. Depending on why and how you want it to generate, if you're making totally new stuff I'd probably suggest not hooking into the existing generation but rather just make your own grounds-up generation code. I've found that with structure generation, the procedural part is very dependent on what kind of structure you're talking about. A regular structure can be done with loops and interchangeable parts while an irregular structure might need to basically just read from a set of schematics.
  2. That's mostly how it works. However, you need to be careful with the word "client" because when you run locally it actually runs on both sides. So the "client" is actually an "combined client and server". You can see some discussion on that point here: http://greyminecraftcoder.blogspot.com/2013/11/how-forge-starts-up-your-code.html Post your code.
  3. Like you said, this is kinda an old topic. But because you brought it up again, I'm interested in this. Why wouldn't the collision bounding box override be sufficient even with stacked blocks? I assumed that when Minecraft is looking for collisions it would invoke the message for all blocks that might possibly collide. So what is explanation for why render as normal block would affect this? Are blocks that are at different height checked differently for collisions?
  4. Where did you add that code? If you read the tutorial (http://jabelarminecraft.blogspot.com/p/minecraft-forge-172-creating-custom.html) that goes along with the code, it explains that that code isn't something you add, rather I was just showing the code in the farmland block that does the processing. I write a lot about what you need to do and how it works in the tutorial. Please read that. But it is actually pretty tricky because the vanilla code is in the farmland block under your plant block When you land on the farmland it turns to dirt. So if you want the plant to die, you have to make sure it doesn't get sustained on dirt. But sustainability is related to the plant type and depending on how you set that for your plant it may not work. So the solution is in my tutorial. I recommend: "So basically you should @Override the canBlockStay() method in your custom crop block class. In that method, you should check that the block below yours is proper block types to sustain your plant. If you want it to die is it is jumped on, you need to make sure that if the block below is regular dirt that you return false."
  5. This is usually caused by instantiating/registering the seed item before the plant block. If you trace your code execution order you'll probably find that the instance of the plant block is null at the time you create the seed item. To fix it, change the order and create the plant block first, then seed item for that plant.
  6. I have a tutorial for 1.7 here: http://jabelarminecraft.blogspot.com/p/creating-custom-entities.html Regarding making something tameable, you can do that by implementing the IEntityOwnable interface. Also you may need to add some of the AI related to how it reacts when owner is attacked or attacking.
  7. Yes, this is a common mistake with custom seeds. As diesieben07 points out, you have actually made your seed plant a "null". This is a Java programming point that is important to understand -- if something is null and you assign another object with its value when you update that something later it doesn't automatically update the second object: it will still point to null. A pattern like this doesn't work: ObjectA objA; ObjectA objB = objA; objA = new ObjectA(); In such an example, objB will stay null. It will NOT track changes to objA. By the way, I have a detailed tutorial on custom crops: http://jabelarminecraft.blogspot.com/p/minecraft-forge-172-creating-custom.html
  8. If your model uses the addChild() method to add boxes into the model (this is a good way to do it), you cannot render individual child model boxes separately. What I do is create two different models in the class for the parts you want different. And then just select which one to render. In other words you can create another set of boxes as model for the child.
  9. felixCrafter, as diesieben07 mentioned you probably need to become a stronger Java programmer before attempting Minecraft modding. Diesieben07's intructions were very clear and so if you don't understand what the "super method" is, or what "overriding" means, honestly it will be extremely frustrating for you to do modding. This isn't at all meant to be an insult, just a recommendation to avoid frustration -- learn Java solidly.
  10. I think ray tracing should be able to work. On the client side, I think you can use Minecraft.getMinecraft().objectMouseOver and check what it is (block or entity).
  11. Thanks. I actually do that at times and perhaps it is the better way to go. But I'm talking the use of the ChatStyle class specifically.
  12. I can use chat components successfully, doing things like making them clickable, translating from lang, etc. However, I feel like I'm not necessarily doing it properly (it seems overly complex) and I'm still confused about some points. First part then is: are there pre-existing styles (like for bold or colors)? Next, can you combine the styles in any way (other than inside a custom style, I mean if you had two ChatStyles can you combine them)? If you want bold and underlined, for example? As far as I can tell, the answer to both questions is "no". You need to edit the style for each chat component you are using. Lastly, what is the "parent" thing about in the ChatStyle class? There is a field referencing parent, and there are comments talking about children and such. I don't really get that.
  13. Just a thought, but can you change the message in the lang file itself? It seems that it is using multiplayer.player.joined or something like that.
  14. If the problem is that the files are large, then "online" doesn't exactly help since they still have to be downloaded for viewing and local files would be faster than online. However, I understand that you may not want to bloat the size of the mod file when it is distributed, so guess downloading the asset later might make sense. I can think of a couple ways of doing this. 1) Open separate browser. I think easiest is just have your GUI open a browser fully -- you can have a warning (not everyone likes having a mod open a browser) and if user clicks a button they are taken to your site with nice online tutorial. To open a browser you can use standard Java method: Desktop d=Desktop.getDesktop(); // Browse a URL, say google.com try { d.browse(new URI("your url goes here")); } catch (IOException e) { e.printStackTrace(); } catch (URISyntaxException e) { e.printStackTrace(); } 2) there are ways to actually embed browsers into GUI, but you'd have to look up tutorial for that. 3) you can download the files during the mod loading and then access them like regular assets or skins. This requires file management though and frankly I think could run into trouble in terms of handling cases like where the computer running the mod isn't online, or if the downloads are taking a long time. You'd probably need to manage threads, files and online downloading -- all of which is quite possible but requires intermediate level of Java programming. Overall remember that Minecraft is just Java -- so anything that can be done in Java can be done in Minecraft. You can probably look up "display online graphic in my Java program" and get information to help. But I personally recommend that you either go ahead and just include the images as regular assets, or if not that then open a regular browser. Everything else is going to take some serious coding.
  15. Like SanAndreasP says the lang file ALREADY is a "config" file. It is a file that any user is able to overwrite if they wish.
  16. Yeah, specifically my tutorial for living entities is: http://jabelarminecraft.blogspot.com/p/creating-custom-entities.html
  17. You should use WorldSavedData because it is automatically saved and loaded for you. WorldSavedData does use NBT to do the saving. NBT is just a flexible structure to allow saving a mix of common data types all together.
  18. Actually no. There are several limitations of reflection. Reflection mostly allows you to change the scope of private fields and methods so they are visible to your own classes. However, it does not allow you to change the methods' code to operate differently. In other words, you can call methods that otherwise would have been private, but you're still stuck with the methods available as they are already written. Furthermore, you can't change scope of things like static final fields. And so on.
  19. You might want to look at my tutorial about AI: http://jabelarminecraft.blogspot.com/p/minecraft-forge-1721710-custom-entity-ai.html I didn't actually do much with a custom AI itself, but I explain a lot about how the AI works generally. Also, if you're doing custom mobs you might want to check out the rest of my tutorial for custom living entities: http://jabelarminecraft.blogspot.com/p/creating-custom-entities.html
  20. Okay, if you look through the navigator code for the tryToMoveToXYZ() method and look closely you'll see that the navigator has a search range and that search range is set in the constructor of the navigator to equal the followRange attribute of the entity. So I think (not certain, but try it) that if you set the followRange attribute of your entity to be larger, then the pathfinding can go farther. However, you should be careful as I assume if you make the range much larger that it could start to create lag as the number of possible paths would grow in the case of trying to find a path in a complicated terrain (like in a forest with a lot of trees as obstacles). Anyway, try increasing the followRange of your entity.
  21. That's weird. As far as I know, the F3+B should show the actual bounding box and as we all know for entities there is only the one bounding box, shared for pathfinding and hit box.
  22. Maybe I don't quite understand the structure your trying to make, but what is specific reason you need TESR? What is the rendering doing that needs to update every tick? Otherwise can't this be done with normal custom blocks? Why can't you just place blocks like normal and "move" them by destroying and swapping block placements? Also is an ISBRH useful for what you want to do -- are the changes in the rendering only when blocks are "moved"?
  23. I don't think it makes sense that "the packet opens a gui" based on a button press. The buttons are already pressed on the client side where the GUI is open. So you can open guis however you want without packets. But if you need information from the server, or if you need gui to cause an effect on the server, that's when you would send a packet.
  24. I have a whole tutorial on custom crops that might help: http://jabelarminecraft.blogspot.com/p/minecraft-forge-172-creating-custom.html
  25. That is weird because it looks pretty straight-forward and I can't see any obvious problem. The one thing I'm slightly suspicious about though is that you didn't center the rotation point in the head. Your head box is 6 x 6 x 6 and so the offset should probably be -3 in the X and Z dimensions not -4. The problem a lot of people encounter with models is that they use offsets to erroneously compensate for bad rotation point alignment. Basically you can make a model look like all the pieces are connected with the offsets but that can break down when rotating if the rotation points weren't set up properly first. Anyway, what happens if you add 1 to the X and Z offsets (the first and third parameter of the addBox() methods for the head and everything attached to it (ears, nose, hat)?
×
×
  • Create New...

Important Information

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