Jump to content

DoomFruit

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by DoomFruit

  1. It's now updated for MC r1.7.10 and finally has proper SMP support (read: sounds from other players). If the server doesn't have this mod installed, you're only going to hear your own jump sounds. (you'll need to copy the links manually, Forge's forum software breaks them) Mod file: http://www.mediafire.com/download/lj1fi8q3u4ddbe7/Player_Sounds_v2.0_[MC_r1.7.10].jar Source file: http://www.mediafire.com/download/lj1fi8q3u4ddbe7/Player_Sounds_v2.0_[MC_r1.7.10].jar
  2. ========== Fluid Warning: ========== Back in Minecraft r1.0, there was a mod by Shockah (http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1272335-shockahs-mods?cookieTest=1) which tinted stone and obsidian blocks blue or orange if breaking them would have exposed water or lava, respectively. I've adapted that for the modern era and changed it to react to all fluids using the Forge fluids API. Stone and obsidian blocks (basically: anything which extends BlockStone) are tinted orange if adjacent to liquids with a temperature greater than 380 (lava, pyrotheum, steam), pale blue if touching liquids with a temperature less than 270 (cryotheum), dark blue if touching a liquid with a temperature between 270 and 380 (most things) and not tinted at all if there's no liquid adjacent. Tints will over-ride each other, the priority is in this order: hot, cold, neutral, none. From back to front, left to right: water, blazing pyrotheum (Thermal Expansion), gelid cryotheum (TE), lava, destabilised redstone (TE), etherium (Ars Magica 2) http://s13.postimg.org/si2tcltur/Fluid_Warning_Screenshot.jpg[/img] (Hyperlinks are broken, copy and paste these directly) Mod: http://www.mediafire.com/download/bsa8jq5j0ae0sks/Fluid_Warning_[MC_r1.7.10].jar Source: http://www.mediafire.com/download/1ql55aazy5mx0jy/Fluid_Warning_Source_[MC_r1.7.10].zip License: A significant proportion of the mod is basically culegooner's class replacement tutorial which is released under the GPL - that means this mod is GPL as well. ============= Silverfish Warning: ============= Blocks which release silverfish when broken are now tinted purple. Nothing more to it than that. http://s13.postimg.org/91i3q2yqr/Silverfish_Warning_Screenshot.jpg[/img] (again, hyperlinks are broken) Mod: http://www.mediafire.com/download/x5wl3j7w4706iyw/Silverfish_Warning_[MC_r1.7.10].jar Source: http://www.mediafire.com/download/68wut2nrhtr6sry/Silverfish_Warning_Source_[MC_r1.7.10].zip Just as with Fluid Warning, this mod is also GPL due to taking large parts from culegooner's class replacement tutorial.
  3. This is a very small mod which changes the behaviour of the sneak key. Basically, you can now tap it and you'll remain in sneak mode unless you tap it again. Holding it works as normal, and the toggle functionality will only activate when you're on the ground and when you don't have the ability to fly. It was originally based off a small jar mod from a long time ago (http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1272371-1-2-3-wdmods-creepers-sneak-and-chat?cookieTest=1), which I updated to the current Minecraft version after seeing how Davidee forced a new instance of the base class into memory with his version (http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1290540-1-7-2-modloader-forge-toggle-sneak-sprint-better?cookieTest=1). The difference between my version and his is that there is no separate keybind here - I hijack the functionality of the sneak key directly. To install, stick the mod in the .minecraft/mods/ directory as normal. The forum hyperlinks don't seem to work - you'll have to copy and paste these manually. Mod: http://www.mediafire.com/download/cmn8ah28qter8b7/Sneak_Toggle_[MC_r1.7.10].jar Source: http://www.mediafire.com/download/bod3vhhnt4t8v0g/Sneak_Toggle_Source_[MC_r1.7.10].zip
  4. This mod is focussed on fixing exactly one type of thing which *really* pissed me off as a server admin. Messages like this in the log file: 2014-09-29 14:28:33 [sEVERE] Wrong location! EntityArrow['arrow'/465, l='TRID_Modworld_04', x=792980147.89, y=-246752109.96, z=-537883796.54] I'm not 100% sure what mod causes this, but I suspect that it may be Thaumic Tinkerer and it's Distortion wand focus (which is constantly active if you are wearing Robes of the Stratosphere) - see also http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1289299-thaumic-tinkerer-thaumcraft-addon-evolve-knowledge?comment=1598 for the official thread. This is extremely unphysical (0.82 light-seconds of altitude on an *arrow*?), might cause unspecified bad effects on the game and will definitely annoy the server admin. So I wrote a very small mod which runs the same check as Chunk.java (which is the source of this error message) and OBLITERATES any arrow which fails this test rather than just logging it again and again and again. What you see in the log file now looks more like this: 2014-09-29 14:28:33 [sEVERE] Wrong location! EntityArrow['arrow'/465, l='TRID_Modworld_04', x=792980147.89, y=-246752109.96, z=-537883796.54] 2014-09-29 14:28:33 [iNFO] Errant entity detected. 2014-09-29 14:28:33 [iNFO] Parent entity unknown. 2014-09-29 14:28:33 [iNFO] Attempting to use setDead() on the entity. This arrow will never bother me again. Do whatever you like with this mod and it's source. I don't care. Mod: http://www.mediafire.com/download/16vn1vbv79jjd41/Entity_Cleaner_v1.0_(MC_r1.6.4).zip Source: http://www.mediafire.com/download/0czjhbzccw62hng/Entity_Cleaner_v1.0_Source_(MC_r1.6.4).zip Yes, 1.6.4. Bite me.
  5. Developing on 1.6.4 without Gradle: http://terrafirmacraft.com/f/topic/5295-compiling-forge-965/
  6. Hmm. I'm really looking to tint all of the visible blocks so that I can get an instant idea of where it's safe to dig rather than having to go up and touch each one individually. The latter does make sense in terms of a "this block feels hot" thing, but it's not really what I'm after.
  7. A long time ago, a guy named Shockah made a mod called Fluid Warning (was here, but he seems to have removed the link) which tinted stone and obsidian blocks blue or orange if breaking one would expose water or lava, respectivel. He stopped updating it after b1.8.1 (I think), so I took a peek at it with JD-GUI and re-created it for r1.0.0, r1.2.5 and r1.4.7 when I started playing on those versions. The way it worked was a base class edit of blockStone (and therefore blockObsidian, which extends blockStone) which added a colorMultiplier if any of the 6 directly adjacent blocks were lava or water. Here's the exact code which gets put in: private static final ArrayList water = new ArrayList(Arrays.asList(new Integer[] { Integer.valueOf(, Integer.valueOf(9) })); private static final ArrayList lava = new ArrayList(Arrays.asList(new Integer[] { Integer.valueOf(10), Integer.valueOf(11) })); public int colorMultiplier(IBlockAccess iblockaccess, int i, int j, int k) { if(containsOR(lava, new Integer[] { Integer.valueOf(iblockaccess.getBlockId(i - 1, j, k)), Integer.valueOf(iblockaccess.getBlockId(i + 1, j, k)), Integer.valueOf(iblockaccess.getBlockId(i, j, k - 1)), Integer.valueOf(iblockaccess.getBlockId(i, j, k + 1)), Integer.valueOf(iblockaccess.getBlockId(i, j - 1, k)), Integer.valueOf(iblockaccess.getBlockId(i, j + 1, k)) })) { return -22016; } return !containsOR(water, new Integer[] { Integer.valueOf(iblockaccess.getBlockId(i - 1, j, k)), Integer.valueOf(iblockaccess.getBlockId(i + 1, j, k)), Integer.valueOf(iblockaccess.getBlockId(i, j, k - 1)), Integer.valueOf(iblockaccess.getBlockId(i, j, k + 1)), Integer.valueOf(iblockaccess.getBlockId(i, j - 1, k)), Integer.valueOf(iblockaccess.getBlockId(i, j + 1, k)) }) ? -1 : 0xffaaaaff; } private static boolean containsOR(ArrayList arraylist, Object aobj[]) { Object aobj1[]; int j = (aobj1 = aobj).length; for(int i = 0; i < j; i++) { Object obj = aobj1[i]; if(arraylist.contains(obj)) { return true; } } return false; } I know that there are several things which should be changed to update it to modern versions of MC - referencing blocks by name instead of block ID, for instance (along with cleaning up the ugly decompiled copy-pasted code into something a little neater). The big stopper is that I can't figure out how to give blockStone this conditional tinting without a base class edit - I don't see any obvious hooks in the Forge code. Can I add a custom colorMultiplier() function to a pre-existing block type (and in this case, with additional code to check the world around it beforehand) without hacking the base classes?
  8. Ever felt like a pansy while jumping your way over the stair-step terrain of Minecraft? Ever thought that your deaths weren't dramatic enough? Ever felt that sitting in lava lacked impact? In short, have you ever wanted Minecraft to sound like a 1996 game? Player Sounds does that for you. Install this mod and you'll jump like the Quake guy does. HUP! Wind up getting killed? Prepare to scream like a C&C 1 infantryman. Step in lava or into a fireplace? It HURTS... and your character won't be afraid to express it. Just stick the mod file in your .minecraft/mods/ directory and you're ready to go. Other players in SMP ought to make the sounds as well, but I haven't tested it in an actual SMP environment yet - any takers? (MC r1.4.6/r1.4.7) Mod file: http://www.mediafire.com/download.php?yddlfs41fc9efn4 Source: http://www.mediafire.com/download.php?utmh8v89d982qd4 Feel free to use the source in any way you wish, but if you distribute this mod or a modified version of it, then you must include your modified source code as well (though it's not particularly complicated and you could probably do it better on your own...).
  9. And I found the problem. PlaySoundAtEntity doesn't work - you need to use PlaySound instead (thanks AtomicStryker, looking at your mod code was most useful). mc.theWorld.playSound(jumpEvent.entityLiving.posX, jumpEvent.entityLiving.posY, jumpEvent.entityLiving.posZ, "fruitmods.playersounds.sound.jumpsound", 1.0F, 1.0F, false);
  10. There are no error messages on the command line - here's the relevant part of the startup logs: [11:37:52] 2013-01-17 11:37:52 [iNFO] [sTDOUT] Registering Player Sounds event handler. [11:37:52] 2013-01-17 11:37:52 [iNFO] [sTDOUT] Loading Player Sounds audio files [11:37:53] 2013-01-17 11:37:53 [iNFO] [sTDOUT] Starting up SoundSystem... [11:37:53] 2013-01-17 11:37:53 [iNFO] [sTDOUT] Initializing LWJGL OpenAL [11:37:53] 2013-01-17 11:37:53 [iNFO] [sTDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [11:37:53] 2013-01-17 11:37:53 [iNFO] [sTDOUT] OpenAL initialized. [11:37:53] 2013-01-17 11:37:53 [iNFO] [sTDOUT] SLEvent called, loading Player Sounds... [11:37:53] 2013-01-17 11:37:53 [iNFO] [sTDOUT] Attempting to load file: file:/home/ltls2/Minecraft/mcp725%20(MC%20r1.4.6)/forge/mcp/bin/minecraft/fruitmods/playersounds/sound/jumpsound.ogg [11:37:53] 2013-01-17 11:37:53 [iNFO] [sTDOUT] Attempting to load file: file:/home/ltls2/Minecraft/mcp725%20(MC%20r1.4.6)/forge/mcp/bin/minecraft/fruitmods/playersounds/sound/playerpain1.ogg [11:37:53] 2013-01-17 11:37:53 [iNFO] [sTDOUT] Attempting to load file: file:/home/ltls2/Minecraft/mcp725%20(MC%20r1.4.6)/forge/mcp/bin/minecraft/fruitmods/playersounds/sound/playerpain2.ogg [11:37:53] 2013-01-17 11:37:53 [iNFO] [sTDOUT] Attempting to load file: file:/home/ltls2/Minecraft/mcp725%20(MC%20r1.4.6)/forge/mcp/bin/minecraft/fruitmods/playersounds/sound/playerdeath1.ogg [11:37:53] 2013-01-17 11:37:53 [iNFO] [sTDOUT] Attempting to load file: file:/home/ltls2/Minecraft/mcp725%20(MC%20r1.4.6)/forge/mcp/bin/minecraft/fruitmods/playersounds/sound/playerdeath2.ogg [11:37:53] 2013-01-17 11:37:53 [iNFO] [sTDOUT] Attempting to load file: file:/home/ltls2/Minecraft/mcp725%20(MC%20r1.4.6)/forge/mcp/bin/minecraft/fruitmods/playersounds/sound/playerdeath3.ogg [11:37:53] 2013-01-17 11:37:53 [iNFO] [sTDOUT] Attempting to load file: file:/home/ltls2/Minecraft/mcp725%20(MC%20r1.4.6)/forge/mcp/bin/minecraft/fruitmods/playersounds/sound/playerdeath4.ogg [11:37:54] 2013-01-17 11:37:54 [iNFO] [sTDOUT] Armour HUD Status v2.4a [MC r1.4.6] loaded. [11:37:54] 2013-01-17 11:37:54 [iNFO] [sTDOUT] Fruit Display Library v1.3 initialised. [11:37:54] 2013-01-17 11:37:54 [iNFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 6 mods EDIT: putting in a sound file that I know isn't present (another entry for "OMGIDONTEXIST.ogg" in the sound_files String[]) gives me this: [12:35:39] 2013-01-17 12:35:39 [iNFO] [sTDOUT] Attempting to load file: null So it at can at the very least resolve a path to the sound files. The jump debug message gets printed to chat every time I jump, so I know that the event is triggering. It's only the sound playback that's giving me problems .
  11. I've moved the sound loading event handler to preInit, but the sounds still aren't playing. The load event is being called now, so that's something at least.
  12. Hi, all. I'm trying to port one of my 1.2.5 mods (it used Audiomod and a bit of base class editing) to 1.4.6 and pure Forge. In its current state, it should play a sound at your location (and that of any other player) when you/they jump. However, I can't get sounds to play and I have no idea why. The jump event triggers, but the sound playback code fails. I'm pretty sure that the sound files are in the correct place - a bit of debug code in the sound file loading section told me that Minecraft is trying to locate the files at forge/mcp/bin/minecraft/(sound path) - so in my case, it's forge/mcp/bin/minecraft/fruitmods/playersounds/sound/jumpsound.ogg Anyone know what I'm doing wrong? (yes, I know, I should use spoiler tags to collapse the code segments, but I don't seem to be able to expand them in my browser) Base mod class: package fruitmods.playersounds; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Instance; // import cpw.mods.fml.common.Mod.PostInit; import cpw.mods.fml.common.Mod.PreInit; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; //import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; // Quake jump and pain sounds, C&C death sounds // mod structure taken directly from the Forge tutorial at http://www.minecraftforge.net/wiki/Basic_Modding // no, I probably don't need half of these includes // but I'm not entirely sure what some of them do @Mod(modid="PlayerSounds", name="Player Sounds", version="r1.4.6-v1") public class PlayerSounds { @Instance("PlayerSounds") public static PlayerSounds instance; @SidedProxy(clientSide="fruitmods.playersounds.PlayerSounds_ClientProxy", serverSide="fruitmods.playersounds.PlayerSounds_CommonProxy") public static PlayerSounds_CommonProxy proxy; @PreInit public void preInit(FMLPreInitializationEvent event) { // register the event handler here // the event handler actually does all of the work for this mod proxy.registerJumpCatcher(); } @Init public void load(FMLInitializationEvent event) { proxy.registerSounds(); // other mods that deal in sounds seem to load their sound files in the load stage } } Common proxy: package fruitmods.playersounds; public class PlayerSounds_CommonProxy { public void registerSounds() { // server no likey soundy } public void registerJumpCatcher() { // the server don't care about handling jump events either } } Client proxy: package fruitmods.playersounds; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.client.MinecraftForgeClient; import fruitmods.playersounds.PlayerSounds_CommonProxy; public class PlayerSounds_ClientProxy extends PlayerSounds_CommonProxy { @Override public void registerSounds() { System.out.println("Loading Player Sounds audio files"); MinecraftForge.EVENT_BUS.register(new PlayerSounds_AudioLoader()); } @Override public void registerJumpCatcher() { System.out.println("Registering Player Sounds event handler."); MinecraftForge.EVENT_BUS.register(new PlayerSounds_PlayerHandler()); } // also, we stick the event handlers for jump events, death events and hurt events here // pain sounds might be a little difficult without basemod editing // since there are already default pain sounds (I think) // sure, we can replace the sound files, but that won't give us lava pain sounds } Player action event handler code: package fruitmods.playersounds; import net.minecraft.client.Minecraft; import cpw.mods.fml.client.FMLClientHandler; // old-style: import net.minecraft.src.ModLoader; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.living.LivingEvent; public class PlayerSounds_PlayerHandler { protected Minecraft mc = FMLClientHandler.instance().getClient(); // was ModLoader.getMinecraftInstance() in previous versions // probably won't be needed once we remove the debug strings @ForgeSubscribe public void EntityJumped(LivingEvent.LivingJumpEvent jumpEvent) { if(jumpEvent.entityLiving instanceof net.minecraft.entity.player.EntityPlayer) { // this bit works fine String jump_debug_string = "Jump by " + jumpEvent.entityLiving.getEntityName() + " at (" + jumpEvent.entityLiving.posX + ", " + jumpEvent.entityLiving.posY + ", " + jumpEvent.entityLiving.posZ + ")"; this.mc.ingameGUI.getChatGUI().printChatMessage(jump_debug_string); // after a bit of debug code has been tried out, it seems that you need to put your sound files // in the forge/mcp/bin/minecraft/(sound path) directory // eg: forge/mcp/bin/minecraft/fruitmods/playersounds/sound/jumpsound.ogg jumpEvent.entityLiving.worldObj.playSoundAtEntity(jumpEvent.entityLiving, "fruitmods.playersounds.sound.jumpsound", 1.0F, 1.0F); // a debug entry explicitly designed to fail does not produce an error message // jumpEvent.entityLiving.worldObj.playSoundAtEntity(jumpEvent.entityLiving, "fruitmods.playersounds.sound.jumpsoundOMGTEMP", 1.0F, 1.0F); // we can't play already-loaded sounds // jumpEvent.entityLiving.worldObj.playSoundAtEntity(jumpEvent.entityLiving, "step.wood", 1.0F, 1.0F); // this is the code from our 1.2.5 version // it still doesn't play and there is absolutely no indication as to why it's not playing // mc.theWorld.playSoundAtEntity(jumpEvent.entityLiving, "fruitmods.playersounds.sound.jumpsound", 1.0F, 1.0F); // SoundManager.playEntitySound("fruitmods.playersounds.sound.jumpsound", jumpEvent.entityLiving, 1.0F, 1.0F, false); // can't call the relevant function directly, because it's not a static function } } } Audio file loading event handler: package fruitmods.playersounds; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.client.event.sound.SoundLoadEvent; public class PlayerSounds_AudioLoader { // this little trick with the array, along with the rest of the sound loading code came from: // http://www.minecraftforge.net/forum/index.php/topic,298.0.html String[] sound_files = {"jumpsound.ogg", "playerpain1.ogg", "playerpain2.ogg", "playerdeath1.ogg", "playerdeath2.ogg", "playerdeath3.ogg", "playerdeath4.ogg"}; @ForgeSubscribe public void onSoundsLoaded(SoundLoadEvent SLEvent) { System.out.println("SLEvent called, loading Player Sounds..."); for (int i = 0; i < sound_files.length; i++) { System.out.println("Attempting to load file: " + this.getClass().getResource("/fruitmods/playersounds/sound/" + sound_files[i])); try { SLEvent.manager.soundPoolSounds.addSound("fruitmods/playersounds/sound/" + sound_files[i], this.getClass().getResource("/fruitmods/playersounds/sound/" + sound_files[i])); } catch (Exception e) { System.err.println("PlayerSounds: Failed to register sound file " + i + ": " + sound_files[i]); } } } }
×
×
  • Create New...

Important Information

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