Jump to content

Ernio

Forge Modder
  • Posts

    2638
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Ernio

  1. I really don't get what so hard, you could even download just SOME mod and look into it. http://www.minecraftforge.net/wiki/Releasing_Mods Other: 1. Run /mcp/recompile.cmd 2. Run /mcp/reobfuscate.cmd 3. Go to /mcp/reobf/* 4. There you will find reobfuscated files (if you messed with code or setup there may be also some Minecraft classes so delete them) 5. Wrap all files to .zip (NOT .rar) 6. If you are using resources throw them inside /mod.zip/assets/[modname]/textures/... 7. You are kinda done except some stuff like mcmod.info, to get those you could look into random mods and change values. Also: I have no idea why are you asking about folder structure if it's you creating one (packages). Also 2nd: So you don't know how to release or you don't know how to make a "folder" (which for java .jar/.zip with packages)? Your Topic/questions are newbi-SHHHH
  2. Dude... Saying "never really used the Math()" is like saying you are a 12 year old and suck in school. Java Math() is just a math. Can't help here if you don't understand what a f(x)=sin(x) is. I can only tell you how to "kinda" make it. 1. float yaw = mc.thePlayer.rotationYaw; //returns total spin yaw of player during Entity existance (read: moment you join the world) 2. Wrap your yaw into smaller values (http://en.wikipedia.org/wiki/List_of_trigonometric_identities) 3. MathHelper.wrapAngleTo180_float(yaw); 4. Do the math for x and z coordinate - well, you can make it even using Pythagoras and sin(x) - I prefere better ways. 5. You got your x and z, now launch: player.setPositionAndUpdate(player.posX + x, player.posY, player.posZ + z);
  3. Really? http://upload.wikimedia.org/wikipedia/commons/thumb/8/85/Coord_planes_color_point_pl.svg/661px-Coord_planes_color_point_pl.svg.png[/img] You set posZ twice. Fixed: player.setPositionAndUpdate(player.posX+2, player.posY, player.posZ); Also: (x,y,z) are coordinates of entity in the WORLD, not in entity coord plane. That means that adding +2 will move your entity in world's grid. You need to either use Math() to get direction that will be added to (x,z) or... Well, this is pretty much only option Edit: And yeah - diesieben07 alredy answered, sry. Edit: For getting player's rottationYaw check out debug in GuiIngame (search for this.mc.mcProfiler.startSection("debug"). Or maybe they added some function that returns rotation automatically? (well, i am using my own Util from 1.1 or earlier so, I don't know)
  4. Well, there are many ways to do the teleportation thing (because "normal" walking process would be harder - that's why I asked). You could make setPositionAndUpdate() and call it inside your onItemRightClick() method. Rest of the code (x,y,z) coords are just math thing, so I am guessing you know how to get entity position, don't you? I am not sure about rotation after teleportation, so if it wont be same as beforte event, you could save players rotation yaw, and then set it after the teleportation event. Edit: Well, just read: /** * Move the entity to the coordinates informed, but keep yaw/pitch values. */ public void setPositionAndUpdate(double par1, double par3, double par5) { this.setLocationAndAngles(par1, par3, par5, this.rotationYaw, this.rotationPitch); } So, no, Yaw stays the same. Also: If you want to make sure that player wont be travelling inside of blocks, you can get world max y for (x/z).
  5. And by "move" you mean teleport entity (player) 2 blocks in some direction (probably front), or actually just a normal movement like on "FORWARD" key that will end after 2 blocks? If the second one, well, are you also considering player walking speed (potions/soulstone) or just want player to walk 2 blocks with "normal" speed? Also: you do understand that if you are alredy walking e.g. forward, and make player walk "again" forward (by rightclicking) this will not stack - I mean, it depends if you will launch single movement or movement over tick.
  6. 1. Use Spoilers. 2. I think this is a wrong section? 3. Post Server Crash log to see if there is also problem with server. (remember - 1.) 4. BattleGear and SmartMoving are not render-compatybile. (just sayin') 5. Does your Single Player work? 6. Try re-adding mods one after another on both client and server and test it before you add next, you will find you issue. 7. Also: Reinstall your whole client, forge and server if you havent done it alredy
  7. 1. Are you changing base classes? 2. This is generally a severe programming error. There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW! - speaks for itself. 3. Inside eclipse you are running deobfuscated code. Mods with obfuscated code won't work. If you are using external .jar mods you have to create references for them/deobfuscate them. (NOT SURE about new Forge) 4. You are probably giving us Eclipse terminal error (which doesn't exist since it only says "Stopping!"). Go to MCP directory, open /jars/ folder and look inside forge logs maybe, I am not saying there will be more, but when I had problems with unknown crashes I always find somthing useful there.
  8. Sorry to make a little Offtopic but I am working on my own mod which uses sounds and hasn't been tested on MP yet, so: "Another flaw with your system is, that it will not work in multiplayer, because you only have one sound toggle." Do you mean that if I create @ForgeSubscribe to an (example) PlayerInteractEvent in which I will call: world.playSoundAtEntity(player, "mod:sound", 1.0F, 1.0F); when player right-clicks some block, this will NOT be played for all players around? I mean: will all players around hear the sound made by some player? And if not, will this crash or just be played for this one triggering player? And (if other won't hear it) do I really need to use packets?
  9. http://www.minecraftforge.net/wiki/Event_Reference You are looking for "Terrain Events" on the bottom of page. In your MainMod you register it in preInit(): MinecraftForge.TERRAIN_GEN_BUS.register(new MyTerrainEvent()); Then you create MyTerrainEvent.class which for example can look like this: public class MyTerrainEvent { @ForgeSubscribe public void changeTerrain([eventname] event) { } @ForgeSubscribe public void changeTerrainInNether([eventname] event) { } } Oh, and look into net.minecraftforge.event.*
  10. I really don't see why it doesn't work, you are probably doing it wrong. LanguageRegistry.instance().addStringLocalization("itemGroup.tabJAGM", "en_US", "JAGM Stuff");
  11. http://www.minecraftforge.net/forum/index.php/topic,11089.msg56842.html#msg56842 I still havent done that, so don't ask me. I can only tell you that PlayerAPI/RenderAPI can do those things (RenderAPI unlocks model methods).
  12. 1. Reflection Total compatibility with all stuff that doesn't touch same code (I mean, you can't override something twice, it's pointless - logical ;p) How: Well, that's more normal java stuff rather than just forge, I would suggest reading java documentation. 2. ItemArray Override Second best way, as told before: Declare new ENUM with your own stats, create new Armour set, make them use your ENUM then in preInit make ID override. Perks of this one is that you still have full compatibility with all other stuff, yet it's not as good as reflection. The downside is that you don't just make some armour work differently, but you tell every method that calls this armour, to use your armour instead. Item.itemsArray[armourID] = MyArmour; Next thing is that you will have two same-different things in your game. You will have MyArmour that has MyID, and Armour that has normal ID, yet when you use use any of them you will always refere to MyArmour (I really belive you understand). Oh, and btw. I am refering to 1.6.x! 1.7.x doesn't have declared static ID's, they are assigned on runtime, so I don't know about this whole " two same-different things", but I am sure that it will work (maybe even same way as on 1.6.x). P.S - your thread title is at least weird ;o (not accurate)
  13. Well, it really depends on if you care about compatibility with other mods. One way to do it is: //Declare new ENUM public static EnumArmourMaterial DIAMOND = ... //Create new Diamond Set with your EnumArmourMaterial //Make replacement in preInit (or load, I don't really remember) Item.itemsList[item.helmetDiamond.itemID] = MyHelmetDiamond; You can also use reflection to edit vanilia ENUMs or... well, delete diamond armours from game and add your own (similar to 1st idea, but causes crashes if you don't secure compatibility) or... Someone else?
  14. Guys, I know you are coders and shit and need specific data, but take a guess what he means, and also to you sir, stop "!!!" every sentence here. Have you even looked at freaking minecraft code? I mean - boat, pig, horse? It's like given on a plate. Just type "boat" in search and you will get goddamn method! /** * Returns the Y offset from the entity's position for any entity riding this one. */ public double getMountedYOffset() { return (double)this.height * 0.75D; } So HARD?!?!? Normal: (0.75D) http://midstcraft.com/75.jpg Changed: (2.00D) http://midstcraft.com/200.jpg P.S - this is not a solution, this is just hint Btw. they are kinda right: We don't even know how is your sitDown() function called, it might me Forge event, it might be command, maybe riding/embarking on something
  15. Well, I've been doing some researches and tests. Put up something via PlayerInteractEvent. Checking with: if (player.isSwingInProgress) playSound() Sadly this means that turbo-swing-speed gives you milti-sound effect which we don't want to get, so I used: player.swingProgressInt Value above is totally I-don't-know-what, beacuse it runs from -1, 0, 1, sometimes 3, 4 or even 5; yet I cannot resolve which is called in what situation, my best shot was to test them, and what I got now is if (player.isSwingInProgress && player.swingProgressInt != 0) playSound() Which gives me BEARABLE effect (not spamming so much during multi-click) *If anyone is interested "0" value is when you you are not performing leftclick. Well, this is one way to do this, yet there is still problem: isSwingInProgress is NOT called when you click on AIR, which makes me want to use pain-in-the-ass-ointment. Second: PlayerInteractEvent is being called for every other something-click (right-click and shit), can it be shortened? (I mean only to left-clicks) Cmon ppl, some ideas? Maybe there is a better way of doing something like this? Thanks
  16. Hello, Seems like I've got another issue. Is there a ForgeSubscribe event that can track player LEFT-click swing? RIGHT_CLICK_AIR, RIGHT_CLICK_BLOCK, LEFT_CLICK_BLOCK WHY THERE IS NO LEFT_CLICK_AIR :C If not (which seems like there is not), would LivingUpdateEvent be good to track if(player.swingItem())? (pseudo)? Any other thoughts? (I need to play sound when player uses swords and shit)
  17. Yes I am retarded, sounds work well when you hold item
  18. Hello, Before I get to coding this: How hard/time-consuming would be adding ForgeSubscribe events that would play sound in "some" cases. Where by "some" I mean swinging sword, hitting blocks with some item, hitting entity, falling, drowning, getting hit, etc. And would that use reflection/ASM AT ALL? (And yeah, that something simillar to MAtmos which is not an option). Also need help here: http://www.minecraftforge.net/forum/index.php/topic,15287.0.html
  19. Thank you good sir. Also I have no idea how to use model renderer on screen (GuiIngame). private void drawCharWindow(final FontRenderer fr, final int width, final int height) { ModelSkeletonHead head = new ModelSkeletonHead(0, 0, 64, 32); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.getTextureManager().bindTexture(STATSICONS); this.drawTexturedModalRect(0, 0, 0, 0, 36, 36); //Skull starts... ResourceLocation resourcelocation = AbstractClientPlayer.locationStevePng; String nick = mc.thePlayer.username.toString(); if (nick != null && nick.length() > 0) { resourcelocation = AbstractClientPlayer.getLocationSkull(nick); AbstractClientPlayer.getDownloadImageSkin(resourcelocation, nick); } mc.getTextureManager().bindTexture(resourcelocation); head.render((Entity)null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F); } This is pretty much copy of SkullRenderer, how do I render model on x:y on screen? (And yes, I've been looking on GuiInventory and other stuff, but I can't see how it renders the char.)
  20. Guys, anyone? How would I do this? (head is added via GIMP to show you what I meant) I know plugin that can get player's skull skin onto item skull, yet I cannot find how is it done How can I make Skull show players face, and then render it like character in inventory GUI. Asking if there is Forge hook for anything related to this, or should I code it from beginning.
  21. Goddamnit Ernio, you had to read it wrong :c Sry m8, too late for me reading
  22. Would getting (pseudo) player.skin and then cutting it with drawTexturedModal work here? (I am not on computer) I'm not sure if I can get it as a resource. Maybe something from Skulls?
  23. Hello, How can I get players face (front). I want to put it on GuiIngame (alredy did window for .png) (like in DOOM game) Either I want to make it inside code so the skin will updated on tick, or everytime game is launched I want the .png to be created and saved is SOME dir (as a resource). Thanks
  24. I never questioned this till updating to 1.7.2 so question is: When world is saved blocks are saved by IDs or wat? (I mean, they are not, so what - objects?) Item A has ID 10000 item B has ID 10001. Seems like when you swap those IDs and make B 10000 and A 10001 minecraft will autocorrect changes, like id's change never happened. It's totally elementary knowledge, but over more than one year I've never looked into it.
  25. I am VERY sorry for giving you wrong idea. Here it is if you still need it, gonna be available for 24 Hours (I think that will do?) Hope I helped (sorry its christmas couldn't do it earlier) New link sent on PM...
×
×
  • Create New...

Important Information

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