Jump to content

sequituri

Forge Modder
  • Posts

    669
  • Joined

  • Last visited

Everything posted by sequituri

  1. What makes you think that the server proxy would have any code to render models or even have rendering code available? It's pretty obvious that you have no idea why a proxy even exists. FMLSidedProxy is a special kind of object that is instantiated only on one side so it has access to side-specific classes and code. The Common proxy is considered the base class of all sides and is usually an abstract class with no method bodies defined or only code common to both client and server and should never refer to rendering or other client-side classes. Client-proxy is the subclass of common-proxy class (or interface) and is put in the SidedProxy annotation to represent client-side only code. Server-proxy is the other subclass of commonproxy specified in the annotation. This class will be instantiated when not running on the server. It can uses all the rendering classes and methods of the client. Both of the derived classes can call super(...) if needed for common code. Which proxy object class will be created and called is automatically determined for you when minecraft runs. The proper object will be put in the field that was annotated (usually proxy). So, common proxy object is normally not used directly; it is only a base class for the proper side-dependent proxy. But, that class is used to declare the proxy field. Like such: // Inside my mod class @SidedProxy(clientSide = "us.sequitur.metalmod.client.ClientProxy", serverSide = "us.sequitur.metalmod.server.ServerProxy", modId = MODID) private static CommonProxy proxy; CommonProxy is declared in my metalmod.common package. It declares all of the methods that are overridden in ClientProxy and ServerProxy. I make my Common proxy either an interface or an abstract class. That way I will not accidentally try to call it's methods or create it. public abstract class CommonProxy { public abstract void commonMethod(...); ... } public class ClientProxy extends CommonProxy { @Override public void commonMethod(...) { // do something on the client super(...); // not needed here as super is abstract and does nothing } } public class ServerProxy extends CommonProxy { @Override public void commonMethod(...) { // do something server side super(... ); // not needed here as super is abstract and does nothing // finish up } } The above classes go in separate java files. I hope that explains things.
  2. I was working on classifying all of the FML and Forge events in the source code. While doing so, I stumbled upon at least one idiosyncrasy that seems anomalous. To wit: ChunkProviderEvent which is defined in net.minecraftforge.event.terraingen package (along with its subclasses), has all of its subclasses fired on the TERRAIN_GEN_BUS bus except InitNoiseField. This last event is fired on the EVENT_BUS bus when it is, in fact, related to Terrain generation. Unless my Forge is out of date, and this has changed, I think it's probably incorrect, as least paradigmatically. Could someone clarify?
  3. If you're using it properly, Eclipse catches and displays errors for all spelling errors. Thus, it never would occur to me that was your problem.
  4. I have about 16 profiles (and game directories for them) and only one copy of each mod. I am on Windows 8.1 and hard-linked the mods I am interested in using for that profile into it's game directory. Now, I downloaded HardLinkShellExt.exe for ease of setting this up, and it works flawlessly. For example, I use NEI in just about all of my profiles, and I have it linked into all of my game directories saving me tons of space. And, If I no longer want that mod in this particular profile, I just delete the link there. If you are computer savvy, I'd suggest you try it out.
  5. I have not checked this recently, but it would be sensible to also check the held item being in the hand (I imagine many mobs could see a floating sword or battale axe pretty well). An empty hand would add no visibility, whereas a full opaque sword would or hammer would.
  6. All I can see from a cursory look is that you neglect to call your superclass constructors. This is normally a serious omission. Also, you have no naming convention being used in your mod code. Variable have Searge names, or uppercase names, and classes have any case (upper, lower, whatever) that happens to hit your fancy names. Yeah, this is a hodge-podge of bad code that will always be hard to understand or debug. Frankly, I don't think you understand how the seed / plant interfaces even work. Registering a block or item should not be done in the constructor. Do it after constructing your item/block, then you have a reference to use or compare against. Did you even use the FMLPreinitialization event to create your block and item? One thing to note, is your method leads to recursive nullity either you create your seed with a null plant black, or you create your plant with a null seed item. Either way, your gonna fail. A seed item has to be associated with a plant block. I don't see that here (plant block created after seed registers it), and so it seems something is trying to place a null block in the world. I recon it's your seed,
  7. Your code is nice to see, however without a crash log it is a crap shoot. Try providing the log of the crash.
  8. That was what I expected, since help would trigger a usage event and it would not like to see null. Glad you figured it out.
  9. If you are going to just copy and paste Minecraft classes, at least delete the obvious Minecraft reobfuscation ID which must not exist in any user created classes!
  10. Correct. Now, unless we see what you have done, there is not much we can do to correct the problem.
  11. sequituri

    -

    He copied and pasted, true. But then, he expects to be able to cast a class to his completely unrelated class. Suggestion: learn java and especially google class type-casting.
  12. It's generally bad to put a variable declaration as the target statement of an if.
  13. Your question smacks of the open-ended type of question like, "I don't have any idea how to write a mod or get started, so take my requirements and make me a mod that does it." Reminder: We don't write mod code for you here. Find a tutorial and try and find a similar thing in Minecraft code.
  14. What do you mean? How can a path be blocked and still be a path? Are you making some sort of massive destruction mob that just destroys all the blocks around it wherever it goes? By the way, destroying a block of sand may not unblock a path unless there are none above that one, otherwise you just get an avalanche of more sand/gravel.
  15. techne code always has to be doctored before it can be used for any coding in minecraft. It generates often completely buggy code.
  16. How do you know it doesn't generate? Where have you looked?
  17. I represents that grid size of the recipe. Normally 4 or 9 is used.
  18. Ouch! That sounds like a huge gaping backdoor security hole. I'm not sure any clients would like to have some arbitrary files sent to a strange server, normally.
  19. Your first problem is in implementation. Only one instance of any item is ever created in a world. All other things like it are echos of that one, or phantoms. Therefore, they cannot have an inventory, since there is no way for that data to persist. Enter ItemStacks, they represent concrete instances of a particular item with representation instance data (in NBT form). They could have an inventory just like a backpack or a bag and save and load the contents. Also, it would always have a stacksize of one and unless you checked for it specifically, lose all of the contents on destruction. You would have your item (possibly implement IInventory and) use the ItemStack to load the slots dynamically on use, and refresh NBT data on closing the container. That would be how I'd do it, but look at some backpack code if you want a better idea.
  20. Okay, so outside of the fuel slot, this seems similar to a crafting table. So, you can use the IRecipe interface.
  21. I would ask the author of CustomNPCs, since he or she would likely know and anybody else would not.
  22. I don't know the exact way Minecraft does their jar security, but here is a link for gradle jar signing tasks: http://www.gradle.org/docs/current/userguide/signing_plugin.html
  23. Check out the site http://docs.oracle.com/javase/tutorial/deployment/jar/signing.html.
×
×
  • Create New...

Important Information

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