
firstdwarf
Members-
Posts
31 -
Joined
-
Last visited
Everything posted by firstdwarf
-
It defaults to 127.0.0.1, of course, but I tried using local host and the communication error still causes a problem.
-
It starts, both programs run perfectly, but on the server list, it doesn't even poll; it says communication error. As I said above, and especially after testing, the problem is that eclipse is disallowing access between my programs or something of the sort. Every line of code I have works perfectly, as my tests using minecraft and an external server show.
-
If you post your code, particularly the lines specified in the log, we may be able to help more.
-
The final vanilla ID is 173, for a block of coal. You CAN use any block ID higher than that but before 256, but it may cause conflicts with other mods. Remember, most blocks don't need to be that low! My best idea would be to make only the blocks in the biome that low, and then make sure that you have a config file for those blocks to pick any one of the exceedingly limited number of slots that might be available. On reading up a bit: since biome blocks are stored as bytes, they absolutely must have IDs under 256. Otherwise, they begin to count negative and the kinds of problems you are having start to show up. In summary: Pick an ID between 173 and 256 and make sure it's configurable to resolve conflicts with other mods. Hope that helps!
-
Are you keeping the block IDs low? I've never had a problem myself, but I've heard that anything over the low 200's or so can cause problems due to being converted to bytes and whatnot.
-
So I use the MCP test server to check every new addition for SMP compatibility. However, after one such addition, the MCP server can't be found. There are no errors for the client or server consoles; it just says communication error on my servers list. After undoing my change, it still didn't fix, and even deleting the relevant methods and class completely didn't change it. After recent problems with eclipse resetting the build path, I'm a bit wary. Is there some reason eclipse would prevent the MCP test server from working? Turning off the system changes nothing. FYI, I'm about 99 percent certain that my code isn't the problem; as I said deleting the entire method (without breaking the code, of course) doesn't help. Throughout this whole thing single player works perfectly and, as I said, there are no error logs or console warnings (that I can find at least). I'm afraid I triggered eclipse to do something behind the scenes without telling me again. Any ideas would be welcome! EDIT: I zipped and tested the mod on an actual minecraft server, and while the feature I was trying to fix doesn't work (of course not; I deleted my fix to try to restore the MCP server), the server itself works perfectly. Therefore, it is some sort of eclipse error and not in my coding.
-
[SOLVED] Canceling Hurt Animation and Sound
firstdwarf replied to firstdwarf's topic in Modder Support
Problem Solved! Turns out only the very first solution that I tried didn't work… all the others worked perfectly. What actually happened is that Eclipse somehow changed its build path and saved the copy of the code that didn't work… I only noticed the problem when I removed some print streams and it didn't stop printing. In summary, Eclipse error like a noob... -
[SOLVED] Canceling Hurt Animation and Sound
firstdwarf replied to firstdwarf's topic in Modder Support
The sound and animation still aren't canceled and I haven't been able to find out where they are called. Checking more code to see exactly what makes creative mode the way it is; everything I've found in the player settings hasn't helped it. -
[SOLVED] Canceling Hurt Animation and Sound
firstdwarf replied to firstdwarf's topic in Modder Support
I remember why I counted this one out. I only cancel the damage when the player is blocking and looking at the entity firing the projectile. Getting the target entity is simple. However, the reason I use LivingHurtEvent is because I can trace the entity that caused the damage. If it's an instance of EntityArrow, I can check the entity that shot it and compare that to the target entity. However, if I use LivingAttackEvent, I only have access to the player, where I can still find the target entity, and the damage source, which I'm not sure is linked to an instance of an entity. However, if there's a way to get the attacking entity from that, I would love to hear it! -
[SOLVED] Canceling Hurt Animation and Sound
firstdwarf replied to firstdwarf's topic in Modder Support
Yeah, I cancel the damage through LivingHurtEvent. I was focusing on canceling the damage and never thought of canceling the attack in the first place. I'll give it a shot; thanks. -
So I've done a lot of research and read through the Entity.java, EntityLivingBase.java, EntityArrow.java, and all various forge events but I can't seem to find a way to do this. I have a situation where I'm canceling the damage from an arrow in a certain case, which is easy. However, despite coming up with multiple methods to simply cancel the damage and knockback, the animation and sound remain. The disableDamage player capability doesn't work. The invulnerable boolean doesn't work, is protected, and appears to only set disableDamage anyway. I tried canceling the sound if the entity in question was the shooting entity, the instance of the arrow, or the player itself but it had no affect; upon too much inspection, the trail of methods led me all the way to a place where the specific sounds I want to cancel don't use forge events to work. Does anyone know how to go about this? I must be missing something. Also, turning the player completely invulnerable, i.e. creative, isn't an option unless someone knows how to add extra commands post event. I found a post method in event_bus but I have no idea how to work it. Any help would be very much appreciated!
-
Shears appear to function by checking if the entity you have right clicked is shearable and, if so, performing the necessary functions. All you have to do is find a way to get what entity is standing on your block. Check out the onEntityWalking method. The final parameter is the entity, which you can then manipulate the same way shears do. Good luck!
-
Issues trying to run Mod on Server 1.6.4 [Not Solved]
firstdwarf replied to SilasOtoko's topic in Modder Support
The server source error should be normal; I think it always spits that error out. Other than that, I guess just troubleshoot. Make sure that the version of forge your mod is created in is the same version on your server. I would also recommend having no other mods on that server just in case there's a conflict and that's the cause of the issue. -
Just a few things that might need to be fixed: First of all, in the version of forge you are using, every single thing beginning with GameRegistry must be placed in the method @EventHandler public void preInit(FMLPreInitializationEvent event) { } Furthermore, I'm not sure you're registering your blocks. Unless // is something I don't know in Java, which is entirely possible, the code should be GameRegistry.registerBlock(unlocalizedName, "unlocalizedName") FYI, usually, internal names aren't "Capital Capital" but camelCase; i.e., no spaces with the first word uncapitalized. Classes are CapitalCase and there are rarely spaces between both class names and internal names. Next, all your constructors should be placed in preInit as well. Right now you have them in load, but load appears to be completely empty; make sure that everything is put here: @EventHandler public void preInit(FMLPreInitializationEvent event) { (Your Code Here) } In summary, register your blocks and items, place all the constructors public static Block SomoniomBlock = new BlockSomoniomBlock(2004, Material.iron).setUnlocalizedName("Somoniom Block"); in preInit, and I think that your language registry and game registry additions need to be there too. If not, you can move the language registry stuff back INSIDE the load method, and if that still doesn't work, place the game registry stuff there too. Check out some tutorials for the most recent version of forge; those tutorials know more than both of us.
-
Your ore may actually be spawning above 45… I could be wrong, but I'm fairly sure that this line int randPosY = 45 + random.nextInt(5); means that your random position Y will always be 45 plus a random number from 0 to 5; basically only 45, 46, 47, 48, 49, or 50. Whatever you wish your ore to spawn above (for example, 1 or 6) and what you wish the ceiling to be (45 I guess) should be used like so: int randPosY = yourMinimumHeight + random.nextInt(yourMaximumHeight - yourMinimumHeight); But don't just take my word for it; I could be wrong. Test it with print streams! After (new WorldGenMinable(ItemList.sorrowfulore.blockID, 9)).generate(world, random,randPosX, randPosY, randPosZ); try to insert this command: System.out.println("(" + randPosX + ", " + randPosY + ", " + randPosZ + ")"); This will print out the exact coordinates of your ore upon spawn. Simply check your console for the spawn location and hunt it down! Good luck!
-
Simple problem, fortunately! Vanilla minecraft automatically shifts every single item ID by 256. Originally, those first 256 ID slots were reserved for blocks. You can change the drop to what you want like this: public int idDropped(int par1, Random par2Random, int par3) { return yourpackage.youritem.itemID; } EDIT: Sorry, missed that you put that in there! In any case, yes, minecraft does this on purpose, but worst comes to worst, just put in return (SaphireIID + 256) EDIT (Man, I've got to stop editing): Also, the first few thousand slots are often for blocks and the later slots are for items. For example, my mod sets block IDs starting at 2500 and item IDs starting at 5000. You can google a list of what mods use what IDs in forge for a general idea of what's good to use and also use a config file to make your ID range fully customizable.
-
I believe if you're just trying to set a texture for an item, you can insert the following line of code: setTextureName("yourmodid:yourTextureName") I'm not sure if you need to make it this.setTextureName() but I don't think so. All my textures are camelCased so I have my texture name camelCased but I'm not sure it matters as long as you're consistent. Also, you can place your textures in a different location- inside the mcp folder, you can create another folder entitled res, which then contains your assets folder. EDIT: The new folder res is simply a workaround for the fact that Eclipse doesn't find textures in the proper location; if you're not using Eclipse, ignore that suggestion! However, if you are, check out the forge wiki page for Eclipse for more info. http://www.minecraftforge.net/wiki/Eclipse#Fixing_textures_not_being_copied Instead of retrieving your modID, you can just type it out. I've had textures work with a separate name from my actual modID; it didn't matter as long as I named my folder the same thing. But that might not work in multiplayer. Hopefully that works for you!
-
Issues trying to run Mod on Server 1.6.4 [Not Solved]
firstdwarf replied to SilasOtoko's topic in Modder Support
Just because a mod works in single player doesn't necessarily mean that it will work properly in multiplayer; for example, I had a reference to the mine craft instance in the start of my own mod that I had to remove. It sounds like you are having issues with your mod after it is placed in actual minecraft but the issues are in the coding; it may help you to run the server from your development environment. By that, I mean that the way you tested your mod (hitting the green run button at the top if you have eclipse) can be applied to the server as well; if you click a little arrow on the side you can run the minecraft server program from eclipse. If it doesn't crash right away, you can then start up the minecraft single player version and connect to your eclipse server. And again, I'm reasonably sure that @Init needs to be @EventHandler and your constructors should be in a preInit method. This is copied from Havvy's forge tutorials, which I recommend you check out; the methods and syntax are reasonably up-to-date (sorry for copy pasting but I either don't know how to hide code or it's not working in my browser for some reason). @Mod(modid="generic", name="Generic", version="0.0.0") @NetworkMod(clientSideRequired=true, serverSideRequired=false) public class Generic { @Instance(value="generic") public static Generic instance; private static Item genericItem; public static Item genericIngot; @SidedProxy(clientSide="tutorial.generic.client.ClientProxy", serverSide="tutorial.generic.CommonProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { genericItem = new GenericItem(5000); genericIngot = new GenericItem(5001) .setMaxStackSize(16).setUnlocalizedName("genericIngot"); } @EventHandler public void load(FMLInitializationEvent event) { LanguageRegistry.addName(genericItem, "Generic Item"); LanguageRegistry.addName(genericIngot, "Generic Ingot"); } @EventHandler public void postInit(FMLPostInitializationEvent event) { // Stub Method } } -
Issues trying to run Mod on Server 1.6.4 [Not Solved]
firstdwarf replied to SilasOtoko's topic in Modder Support
What version of forge/minecraft are you using? In later versions (somewhere around minecraft 1.5.2 I think) @Init was replaced by @EventHandler. Also, I think classes are placed in preinit and not load. -
[SOLVED - Derp] Unable to Recompile - Java 1.7 JDK Mac OSX 10.9
firstdwarf replied to warlordjones's topic in Modder Support
The tutorial for recompiling you are using may be outdated but I don't know for sure. Personally, I have the same OS and JDK version as you and to recompile, I run a different chain of programs. I run recompile.sh and then reobfuscate_srg.sh. I believe reobfuscate_srg.sh is what you run if your mod does not edit any base classes. You may want to give that a try; good luck! -
[SOLVED] Class not found with proper file structure?
firstdwarf replied to firstdwarf's topic in Modder Support
Solved it! After checking as you suggested, I discovered an issue with compressing on a mac (though, as always, I could be mistaken in the warning to follow). A WARNING TO MAC USERS: Recent versions come with a handy dandy tool for compressing and opening .zip files. This works perfectly to open any file you choose. When opening a file, it creates a folder with the same name as the original zip file. HOWEVER when you select right click on your file and select compress, the tool appears to make a zip file of your original folder; i.e. StarTechRelease becomes File.zip-->StarTechRelease-->whatever else. It can't convert your file straight to file.zip with the contents directly underneath like it does when opening files. The process works differently depending on whether you are zipping or unzipping. Furthermore, there is an extra upper level to the zip file containing folder that appears to identify the file as made on a mac, or possibly compatible with mac utilities. Moral of the story: the archive utility adds to your .zip AND hides those additions when you try to open your zip. I would recommend using a third party application to compress your files; only a third party application showed me the hidden files ruining my mod. EDIT: @GotoLink, I realize that other mods are run the same way now. The compressing tool opened all files in a way that created an additional folder in front. Combined with being unable to easily create any .zip with whatever files you choose directly underneath, it makes for a dangerous combination. -
[SOLVED] Class not found with proper file structure?
firstdwarf replied to firstdwarf's topic in Modder Support
I'm on a mac, so I can't use winrar without exporting to the windows side of my machine, which I did. However, I'm not sure what you mean by zip root and my best efforts at googling have been fruitless. Sorry to ask, but could you explain further? On simply extracting the files, where would the zip root be located? Is it not extracted? -
Sorry to post in an area that's well documented, but I'm at my wits' end! My package is firstdwarf.StarTech and my class is StarTech. As far as I can tell, I'm following the mod packaging guidelines laid out extensively on this forum. I have tried multiple package names so as to only have one file instead of two. When I create a zip file, the name of the zip file itself shouldn't matter, should it? Every example I find from a mod has a zip name they set themselves. When I unzip the file, it creates a folder whose name shouldn't matter. Inside that folder, the first folder is firstdwarf, the second StarTech, and StarTech contains every file for my mod, including the class file StarTech.class. So I don't understand why I get a class not found error for firstdwarf.StarTech.StarTech!!! From extensive testing and throwing different configurations at it, the mod only seems to work when the file that is zipped is the firstdwarf folder itself- that is, when i unzip the file, it creates the folder firstdwarf. This does not appear to be the case with any other mod I can find, please help!!!
-
Ah; I'm overwriting myself in my own files. Once again, my mistake!
-
[SOLVED] New dimension not generating top blocks and filler blocks
firstdwarf replied to ybilta's topic in Modder Support
Edit: I'm using a build from before the change; you are correct in your placement. Sorry about that!