-
Posts
1283 -
Joined
-
Last visited
-
Days Won
2
Everything posted by jeffryfisher
-
[SOLVED][1.7.2]My entity render causes server side crash`
jeffryfisher replied to jabelar's topic in Modder Support
Could you please post what you ended up using for v1.7.2 (or 1.7.10)? I've just run into the same thing, but I began modding with v1.7.2, so I've never learned proxies. I tried looking at older code, and I am bewildered by all of the differences. I'm so frustrated, because my mod works PERFECTLY in Eclipse SP, but it blows up on launch as soon as I try to launch a real server. My error messages mirror your OP. I've tried Googling "Minecraft Forge client proxy in 1.7.2", and I got only TWO hits (your thread and a v1.6.4 thread that mentioned 1.7.2 as an aside). That has me worried -
Sound works in the Forge version that I have, so I think you should get that one.
-
I think that's it! If I understand it correctly, then it's only for the class members beyond standard entity stuff (x, y, z are already handled). I'll pick thru EntitySpawnMessage in more detail before deciding what needs to be in my read and write, but it looks as if EntityHanging is not one of the subclasses served, so I'll start from there down my inheritance line. I also found an entity registration method. With just one entity class in my mod, I'm calling thusly in my main's init method: EntityRegistry.registerModEntity (classAltPainting.class, MODID, 0, MODID, 128, 20, false); I'll check the other info posted here to see if I should pass different values.
-
For the elevator, look at how minecarts work, then do a "minecart" that can move up & down (and looks like an elevator). Since the minecart is an entity, I think your elevator will end up being one also. In fact, you'd do well to subclass the EntityMinecart class. BTW, the "Railcraft" mod already does vertical rails for vertical minecart movement, so somebody has already solved this problem (i.e. it must be possible).
-
I'm making a new mod that subclasses paintings. Instead of just one texture file full of paintings, I will have 16 files, the file number being set to the color of carpet (in place of wool) used to craft my new painting item. I think I got the item-to-entity stuff figured out, and I even wrote a renderer. However, the client-server communication has just thrown me for a loop. Because my alt painting entity has an extra parameter (the texture number), the vanilla packet & handler doesn't work (I wish it had wrapped and sent the NBT tag, 'cause I overrode the read and write of that, but no such luck). It looks like I'll need to define my own packet to replace S10PacketSpawnPainting. That doesn't look to hard, but... Where's the hook to tell MC to actually use my packet when it has my subclass of EntityPainting? Right now, it detects an instance of EntityPainting and flows into the vanilla handler for paintings (where it blows up). Is it even possible for me to intercept that flow and insert my own code? I don't think I need a whole channel, just a custom packet on whatever channel is used for paintings. Granted, I've only done an hour's reading on packets, but all I've done is confuse myself more. The one "tutorial" I found online told me all about what to put into a packet, but it said nothing about how to get MC to use it. Is there an explanation somewhere that you can point me to? Thanks
-
You may need to refine the argument further. On my ancient WinXP machine, "\users\" is "\Documents and Settings\". I also found that my .gradle folder tree was empty below "legacy", so I hunted down my primary .minecraft installation and pointed to its assets instead: --assetsDir "C:\Documents and Settings\Jeff Fisher\Application Data\.minecraft\assets" In my case, pointing to assets (not \virtual or \legacy) did the trick. I didn't trust my fat fingers to type it all, so I selected the folder in windoze explorer and copy-pasted from its address box. If you do a search for Minecraft's assets on your computer, then you can avoid system idiosyncrasies by copy-pasting from your own explorer (does Win8 still allow you to use it?) rather than anything posted in this thread. And don't forget to put double-quotes around the string if there's even a chance of a delimiter (such as a space) appearing anywhere in it.
-
If you have a minecraft client installed on the same machine as you use for development (because you're both a player and a modder), then you can find its assets and point Eclipse at them by passing an extra argument in the run -> configurations dialog. Add something like this: --assetIndex 1.7.10 --assetsDir "C:\Documents and Settings\Jeff Fisher\Application Data\.minecraft\assets" Note the double quotes used to encapsulate the string that has spaces within it. I think this is throwing some people who imitate an unquoted example but have a username containing a space. If you don't have a client installed on your dev machine, then gradle has an assets folder, but its ~/virtual/legacy folder might be empty, requiring you to go find some contents to copy there before pointing to it. See "C:\Documents and Settings\<user name>\.gradle" or "C:\user\<user name>\.gradle" (adjust to your OS version).
-
...Translating "C:/Users/Aaron" into whatever your filesystem uses. I am trying this now... UPDATE: I got sound, but I needed to do a couple things differently on my ancient WinXP machine. Firstly, the .gradle file hierarchy had assets, but /virtual/legacy was empty. Since I saw my primary .minecraft app data nearby, I found the path to its assets instead. Secondly, XP uses the old C:\Documents and Settings\... structure, and the spaces in the path string require quotes to pass as an argument. Putting the two moves together, I got this argument for my run configuration, and miracle of miracles, it works: --assetsDir "C:\Documents and Settings\Jeff Fisher\Application Data\.minecraft\assets"
-
I'm using Forge 1.7.2, so I don't know squat about proxies. However, I found another route via the ordinal() method of enum ArmorMaterial. As long as every armor registers a new material, this works: private static final String prefix = "ruby"; public static final ArmorMaterial armorRuby = EnumHelper.addArmorMaterial (prefix, 33, new int[] { 3, 8, 6, 3 }, 25); private static final int ARMOR_INDEX = armorRuby.ordinal (); That frees me to use addNewArmourRendererPrefix(prefix) only on the client side, and I just have to hope that the indices will align (or not matter) if there are ever multiple mods.
-
My mod (like many) introduces a new gem to use for tools and armor. I've got single-player working. However, when I try my mod on a server, I run into a paradox. My armor classes constructor calls its super, and the super constructor demands an index that it can assign to renderIndex. I could simply pass a literal '5', but then my mod would collide with every other armor mod in the universe that does the same thing. So I would like to pass the result of a method instead of simply '5'. The method I found is addNewArmourRendererPrefix (prefix). Unfortunately, like others before me, my call to that method blows sky high on the server side. The reason is immediately obvious: The method uses members of the RenderBiped class, and the server doesn't load it. But my problem remains: I don't want to use a literal 5 that is guaranteed to collide with other armor mods. So how do I resolve this dilemma? How do I get a unique "next" armor index for my super() call without upsetting the server? EDIT: I'm now investigating enum ArmorMaterial for some way to arrive at the same number that render would have given me.
-
My mod added a suit of armor in a new material. Amazingly, that much works. However, when I take off my armor in creative mode (e.g. to enchant or repair pieces of it), the empty armor slots in my creative inventory are black squares instead of armor-piece outlines. Surprisingly, survival mode is unaffected. It appears to be a small thing, but I've learned from unpleasant experience that even small visible defects can can spring from bugs that are doing worse behind the scenes. Therefore, I am trying to figure it out anyway. I've walked through as much of the vanilla armor class as I can, and I didn't see how it could have been affected by what I modded in my armor class. I didn't even touch the method that registers those icons. Then I tried commenting out my added creative tab. Voila! The empty slot icons returned to normal in creative mode. Has anyone else noticed the slots turning black after adding a creative tab? Is it a forge bug, or a tutorial oversight, or must I have done something wrong? My creative tab code: EDIT: Looking at how vanilla tabs are instantiated, I noticed that they did not have the @Override annotation on getTabIconItem(). I removed it from mine, and the empty slots returned to normal. I don't know why, but the fix worked. Somewhere out there is a tutorial that is teaching new modders like me to put that @Override in there. If anyone spots it, please ask the tutor to make a correction.
-
I'm looking for a Forge 1.7.2 tutorial on how to get started creating mod minecarts and rails. Since I don't see one, I'll just dive into the vanilla classes and see if I can figure it out myself. If anyone knows any online examples of java files with rail mods, please point. Thx!
-
[1.7.2][Block properties?] return different block when broken?
jeffryfisher replied to Dom323's topic in Modder Support
Instead of extending the general Block class, consider extending the BlockOre class that is itself an extension of Block. Then, in your constructor, add a line like: this.setHarvestLevel ("pickaxe", 2); // Iron or better pick Look inside BlockOre to see what it adds to Block functionality. If you see something (like quantityDroppedWithBonus) that you want imitate, then override it with code for your subclass of ore. -
Agreed. If we forge it, then maybe we can fix that. Also: If something is currently kludged in vanilla code, then it is prone to being "fixed" in a future Minecraft update. I need to learn about transformers. They look like fun.
-
Aha, so the horse's armor slot also needs to gain intelligence (to accept mod armor items). Since horse armor would have been mostly a programming exercise for me (at the tail end of a new-ore mod), I can afford to wait to see your "hooks" when they get pulled. I've subscribed to the thread you linked, so please post here or there again when there's a forge upgrade with your horse-armor hooks in it.
-
There are some tantalizing openings in entity.horse. If we can change (I think) just the following three methods, then we can add mod armor types with textures and protection values. 1) Method private getHorseArmorIndex (ItemStack) translates an armor ItemStack into a horse armor index (e.g. 3 for diamond horse armor). If we can get inside this function, then we can inject indices above diamond's value of 3. Because we don't want multiple mods to compete for number 4, I recommend that mods not use literal numbers. Instead, we would want a mod to call a registration function that returns the next available index. 2) The static final armor values are used only in public getTotalArmorValue(), which means we can use indices above 3 to inject mod values here. A mod might even be able to detect and apply an effect for the basic "protection" enchantment here. 3) Similarly, the static final texture-path strings are used only in private setHorseTexturePaths(). If we can change that function (specifically the final two assignments at the end), then we can intercept mods' indices above 3 and use them to inject mod texture-file paths. The last mystery I saw was field_110273_bx[armorIndex], which appears to be a suffix being appended to a hashed resource label (meo, goo and dio look like metal-o, gold-o and diamond-o, where o might be legacy code for ore). I think that as long as we append any unique string for each armor index (like the index itself), then it will serve to put and get the resource object to and from its hash. I think that's closure on horse armor modding. If I only I knew how to create "hooks" so that I could start the programming!
-
I'm doing something similar, but I'm imitating netherrack. I want my block to be flammable, but I don't want fire to spread or consume. Paradoxically, netherrack is missing from the list of examples in the vanilla BlockFire. It's perpetual fire must be declared somewhere else, but it's not in the netherrack subclass of Block. Still hunting...
-
[Solved][1.7.2] Fortune effect on Custom Ore
jeffryfisher replied to Noxon's topic in Modder Support
I like it too. Since my ore normally drops just 1 gem, I boiled it down further. I don't even need quantityDropped(). public class classRubyOre extends BlockOre { public int quantityDroppedWithBonus(int fortune, Random rnd) { // int n = this.quantityDropped(rnd); // Use when an ore normally drops random multiples (see Lapis in vanilla BlockOre class) if (fortune > 0) { // There's fortune, but will it grant a bonus? // Here is my fortune formula. It can be tuned to suit game balance. // If emulating in another ore, tweak this expression to suit. int j = rnd.nextInt(fortune + 2) - 1; // linear, even dist from -1 to 3, 4, or 5 inclusive if (j > 0) { // Yes, there's a bonus! Add the usual 1 and return return j++; // was: n * (j++) } } // No bonus; return the usual 1 return 1; // was: n } } -
Forge put a tantalizing getArmorResource() method into RenderBiped. By honoring the register armor prefix, I had the default producing the exact string I needed for my armor model resource... except that the domain (modid:) was missing from the front. I couldn't for the life of me figure out how to inject modid (or grab the s1 string and concatenate). I gave up and overrode Item.getArmorTexture to produce the entire domain:path string myself. It works, so I am happy with the result, but... It would be so much more elegant if there were a simple way to inject my modid somewhere that Forge's method would be able to finish the job that it starts so nicely. Maybe modid could be passed along to addNewArmourRendererPrefix(), which could append it to a parallel armorDomain[] array pre-seeded with "minecraft" entries for the vanilla armor levels. Then domains would be available when s1 (_default) is formatted. Modders adhering to the <modid>:textures/models/armor/<prefix>_layer_<layer>.png format would be done without overriding getArmorTexture(). Not only that, but modders would be led into creating dynamic armor indices rather than all trying to claim 5 (a collision waiting to happen if/when mods are shared and combined).