[INACTIVE][FUN] HigherExplosives v2.0 - Configurable multiworld explosion control [860]

Discussion in 'Inactive/Unsupported Plugins' started by toadmess, Feb 27, 2011.

     
  1. Offline

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    HigherExplosives - multi world control of explosions (size, player/creature/terrain/item damage, % items dropped, and TNT fuse duration and permissions support):

    Version: v2.0

    With some simple tweaking to the automatically created config.yml file, you can individually change the TNT, creeper, or fireball explosions for all worlds, or tailor specific worlds.
    The configuration is fairly flexible, so with some more determined configuration there are a myriad different worlds with exotic explosion qualities that can be crafted. :)

    It was compiled and tested against CraftBukkit version 860 (recommended build).

    Features:
    • Control the size of explosions for TNT, creepers and ghast fireballs.
    • Control the percentage of dropped items (called yield) from the destroyed blocks, from no items dropped through to one item dropped per destroyed block.
    • The yield of every different block type can be individually configured if so desired.
    • Optional prevention of terrain damage
    • Multiple world configurations
    • Allows configuration of different blast radii, with different probabilities for each being chosen
    • Allows configuration of different player damage (optionally with different probabilities for each being chosen)
    • Allows configuration of different creature damage (optionally with different probabilities for each being chosen)
    • Item damage can be configured (optionally with different probabilities for each being chosen)
    • Fuse length of TNT can be tweaked.
    • Some simple control over which areas the modified explosions will happen in
    • TNT triggered by redstone, fire, explosion, or by a player's hand can be configured separately
    • The triggering of TNT can be prevented (either generally, or specifically for fire, explosion, hand, or redstone)
    • Permissions support for TNT triggered by hand. Any number of different configurations for players with certain permissions and/or groups can be applied.
    • Charged creeper's explosions can be configured
    Downloads:


    The v2.0 HigherExplosives.jar is at https://github.com/downloads/toadmess/HigherExplosives/HigherExplosives.jar

    In case there are problems with v2.0, the older v1.7 HigherExplosives.jar is still available from https://github.com/downloads/toadmess/HigherExplosives/HigherExplosives1.7.jar

    The source code (changes are most welcome) is at https://github.com/toadmess/HigherExplosives/

    Install:

    Straight out the box this will double the size of TNT explosions. No configuration required, just drop the HigherExplosives.jar in the plugins directory.

    Known issues:

    • If you set the yield too high, the server will lag a lot whilst trying to rotate all of the items left in the crater.
    • If the radiusMultiplier is much less than 1, I think the client is rendering the explosions as normal, but then corrects itself a moment afterwards when it hears about what really happened from the server. This has a kind of double-take effect.
    • If the radiusMultiplier is set too high, the shape of the terrain damage takes on a kind of streaking or criss-crossing effect. I think this is to do with the way minecraft creates the explosions (http://www.minecraftwiki.net/wiki/Explosion).


    Example Configuration:

    For full configuration details check out the README file at https://github.com/toadmess/HigherExplosives/tree/v2.0

    Meanwhile, here's a contrived example configuration that covers most of the simpler features, together with an explanation below it:

    Code:
    entities:
        TNTPrimed:
            yield: 0.15
            radiusMultiplier: 2.0
        Creeper:
            preventTerrainDamage: true
            activeBounds:
                max:
                    x: 500
                    z: 500
                min:
                    x: -500
                    z: -500
    worlds:
        world_nether:
            entities:
                TNTPrimed:
                    playerDamageMultiplier: 2.0
                    itemDamageMultiplier: 0.0
                Fireball:
                    fire: false
                    creatureDamageMultiplier: 2.0
        wildwest:
            entities:
                TNTPrimed:
                    radiusMultiplier:
                        - {chance: 0.25, value: 0.3}
                        - {chance: 0.25, value: 1.5}
                        - {chance: 0.5, value: 1.0}
                    trialTNTFuseMultiplier:
                        - {chance: 0.5, value: 0.0}
                        - {chance: 0.5, value: 1.0}
                Creeper:
                    yield: 0.0
                    yieldSpecific:
                        2: 0.8  # Grass
                        3: 0.8  # Dirt
                        12: 0.8 # Sand
    version: '2.0'
    debugConfig: true
    
    In this example config, the size of TNT explosions are doubled and the number of items they drop is set at 15%. This would by applied by default in all worlds except the world named "world_nether" and the world named "wildwest".

    In the world named "world_nether", TNT explosions will have a normal blast radius and yield, but nearby items will be impervious to them. Whilst they don't damage items, TNT explosions in the nether will be twice as damaging to players when exploding, but creatures will take damage as normal.

    By default, creepers will not damage terrain in a 1000x1000 square area around 0,0. They will however still damage creatures and players as normal. Outside of the safety area, the terrain will be damaged as normal by Creepers. This applies to all worlds with this example configuration because no other world has a specific configuration for the Creeper entity.

    Ghast fireballs in the "world_nether" world will not cause fire but will be twice as damaging to other creatures. They'll damage players as normal fireballs do. Fireball explosions in any other world will be left unmodified.

    In the wildwest world, TNT is flakey and unreliable. 50% of the time TNT will explode immediately without any fuse. The sizes of the TNT explosions will also vary, with half of them being normal, a quarter being very small, and a quarter being fairly large.

    Creeper explosions in the wildwest will cause destroyed grass, dirt and sand blocks to drop items 80% of the time. All other destroyed blocks will drop nothing.

    To check if the plugin is reading the configuration correctly, you can add a "debugConfig: true" property. It defaults to false if it's not in the config file.


    Changelog:

    Version 2.0
    • Nested configurations allow completely different behaviour for TNT depending on whether it was activated by fire, player, redstone, or some other explosion.
    • Permissions plugin support. Allows any number of configurations to be applied when a player's hand triggers a TNT block, so long as the player has the necessary permission and/or belongs to the necessary group.
    • Charged creepers can now be specifically configured with the "creeperCharged" nested configuration.
    Version 1.7
    • The yield of specific block types can now be individually configured via the "yieldSpecific" property.
    • Renamed the "trialTNTFuseMultiplier" config property to "tntFuseMultiplier"
    • Massive internal restructuring of the code. Should be more lean and mean.
    Version 1.6

    • (Experimental) TNT fuse durations can be configured via the "trialTNTFuseMultipler" property.
    • Item damage can be configured via the "itemDamageMultiplier" property
    Version 1.5.1

    • Now detects the MiningTNT plugin and works with it (specifically the yield values)
    • Checks for cancelled events, so it plays a little nicer with other plugins that cancel an event.


    Any dontations are not necessary, but are certainly appreciated! All the money goes to charity (currently going to Doctors Without Borders) except for the very occasional beer which will go to me :)
  2.  
  3. Offline

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I think the terrain damage is determined by the blast radius. You'd probably need a very big blast radius though. There's an excellent article here on explosion radius and block resistance. I've not tried to digest the maths involved, but it's clear you'll need an enourmous blast radius. Good luck.

    There may be an easy way to change the level of damage caused to blocks. I'll keep an eye out for it.
  4. Offline

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Taco and I have both now updated the plugins to make them work together.
    Just grab the latest .jar for both plugins and it should be fine.
  5. Offline

    zeph

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Ive been testing the mod and the config we made up, and it's working fantasticly.

    Minor bug though, with "preventTerrainDamage: true", explosions cause no sound. Probably a complex fix, since i don't think the server can issue sounds to play?
  6. Offline

    Szandor

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Thx a ton... both of you.. you made me a happy minecraftian :D
  7. Offline

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    That's strange. I just tried this with craftbukkit 670 with just this plugin installed. Detonating TNT with the preventTerrainDamage set to true still plays the explosion sound for me.

    Is it TNT that's silent for you, or some other entity? Do you have any other plugins installed?

    Edit: Actually, yes I'm seing the occasional explosion with no sound. I'm running the server on the same machine - perhaps the speed of the network affects it? I'll try and track it down.
    You're right, Bukkit doesn't seem to support making sounds, but it is possible to go directly and poke minecraft in just the right spot to produce sounds (though this method may need fixing whenever a new minecraft version is released).
  8. Offline

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Version 1.5.2. This fixes the explosion sounds when terrain damage is being prevented (when the config.yml contains "preventTerrainDamage: true")
  9. Offline

    TankFox

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    This mod, combined with EggGrenades, is the most fun I've had in a long time
  10. Offline

    blspyro

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    ii like this mod however would love a way to have to settings which would be enabled through command in game.I want to be able to make a miner tnt and a nuke so for example /nukeon /nukeoff and /minetnton /minetntoff....i dont know how hard that would be but i hope it can be done.

    Thank you
    PyRo
  11. Offline

    zeph

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    It was the Creepers who were silent., but recently they've been fine. (EDIT - because you patched it ! :D )

    How about adding the option to prevent TNT chaining? IE one TNT explosion triggers the next? Would help with the anti-griefing side of things, limiting TNT to be used one at a time.
  12. Offline

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Great, glad that's working now. The fix is a little exotic, so there's a chance it will fail when the next version of minecraft comes out. Any fail should hopefully be graceful though.

    Inspired by your request for admin only TNT configurations, I'm hoping to version 1.7 the possibility for having different configurations for the different ways in which TNT can be primed. This would let TNT explosions act differently depending on whether they were primed by explosion, fire, player hand, admin hand, or redstone.

    I think it would be possible to use this same configuration mechanism to prevent TNT chaining - i.e. you could have a special configuration for TNT blocks primed by explosions, which just nullifies the explosion.

    I'm not too sure, but it's possible the "preventTerrainDamage: true" config might already prevent another TNT block from being primed by an explosion. I think it's considered to be part of the terrain.
  13. Offline

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Heheh, this made me smile, thanks :)
  14. Offline

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I've been holding off making commands for a while because it's difficult to see how they could easily be used with complicated configurations. However, your example of toggling different configs on or off seems nice to use.

    Perhaps a compromise could be to switch between different config.yml files with a command in game. e.g. something like "/heconfig nuke" would change from the default config.yml file to nuke.yml. Would that work for you?
  15. Offline

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    New version 1.7 works with the latest recommended build 677 and has support for:
    • Changing the TNT fuse duration via the "trialTNTFuseMultiplier" property. This is EXPERIMENTAL, so please let me know if anything's awry with it. When it's shown to be stable, I'll rename the configuration name to just "tntFuseMultiplier".
    • The "itemDamageMultiplier" property. Applies to any non-living entities caught in the blast (including items on the ground, paintings and other things like that). Set it to 0.0 to stop items from being destroyed in blasts.
  16. Offline

    Keno

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Awesome! Just what I was looking for, keep up the good work 8]
  17. Offline

    blspyro

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    How would i do this? That would be ok however a simpler command would be nicer...
  18. Offline

    zeph

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I shall test.

    Holy crap thats awesome!
  19. Offline

    BigRenegade

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    One other thing you must remember when editing a yml files is that you can NOT use the tab key. All indents are 4 spaces and you must use the space bar to make the indents, otherwise the yaml parser will not load it and you will get errors.
  20. Offline

    BigRenegade

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    For those who wonder, it still works fine with bukkit 766, the newest RB.
  21. Offline

    angus22397

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Yeh it does seem to work fine.
  22. Offline

    QQCucumber

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @toadmess Since Minecraft SMP does not seem to properly support the larger explosion for supercharged creepers, do you think you could include a feature for those of us who are just fine with the current explosion sizes of creepers/TNT but want a supercharged creeper to actually function properly?
  23. Offline

    Sparky20

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    This mod is really good, just what I have been looking for.

    It would probobly be a bit of work. But could you let us udjust the yeild for individual blocks.

    Eg. Drops from all ores. 10% drops from cobble and dirt, 50% for everything else.
  24. Offline

    Pantheis

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I would like to second the previous poster request in allowing configured drop percentages for the type of block.

    As an example:

    Stone drops cobble only 10% of the time, dirt 25% of the time, gravel 10% of the time, other blocks 100% of the time.

    Right now, I have every block drop 100% of the time but it's a pain running around collecting all of the cobblestone. :)
  25. Offline

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Good point! Yes, it definitely would be good to configure these explosions.

    I'll try to get experimental support for this out in version 1.7 in the next 3 days, but it might slip to version 1.8.
    It's a bit tricky to test though, so you'd have to let me know if it works! :)
  26. Offline

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @Sparky20 @Pantheis
    Three people have asked for this now, so I'll look to getting it in at some stage, probably in version 1.8, or 1.9. Have you looked at the MiningTNT plugin to see if it can do what you want?
  27. Offline

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I've recently escaped from some crushing workload, so am hoping to get cracking with development again. In the next 3 days, relevant gods willing, will be version 1.7.
    The only new features for 1.7 will be support for specific configs for TNT triggered in different ways, e.g. triggered by redstone, triggered by player, triggered by fire, etc.
    But 1.7 includes a major internal restructure of the code, which beyond optimisations, should also make future features easier to develop.

    Future features planned for version 1.8 (unless they can be put in 1.7 in time):
    - Charged creeper configs
    - Permissions support. Different configs for TNT triggered by players with some named permission.
    - Permissions support. Different configs for Creepers' explosions when creepers are triggered by players with different permissions. i.e. The player that the creeper is attacking is the player that triggered the creeper.
  28. Offline

    Pantheis

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Alright, thank you. I have looked at MiningTNT and it can't be configured to do what I want. I can use it to configure which block types I want to destroy and which ones I want to be immune, but there are a number of issues with it.

    First, it ruins chained explosions due to limitations/bugs in the addon. The second is that I don't want to limit block types that can be blown up. I want to blow up everything, but have a configurable percentage per block type in terms of drop rate. I want stone to only drop 25% and have the rest of the cobble just blown up, but I want all ores to drop 100%, if that makes sense.

    I think the best addon to put that feature into would be this one. :)
  29. Offline

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Makes perfect sense - I'd actually love to have exactly that on my own server.

    In terms of config, I'd see this as looking something like:

    Code:
    entities:
        TNTPrimed:
            yield: 0.1  # Yield chance for all blocks which aren't mentioned in the specificYield
            specificYield:
                1: 0.25   # Stone
                14: 1.0   # Gold ore
                15: 1.0   # Iron ore
                16: 1.0   # Coal ore
                21: 1.0   # Lapis lazuli ore
                56: 1.0   # Diamond ore
                73: 1.0   # Redstone ore
                73: 1.0   # Glowing redstone ore (hmm)
                89: 1.0   # Glowstone
    
    Where the numbers are the block IDs taken from http://www.minecraftwiki.net/wiki/Data_Values

    Please let me know if you see any room for improvement.
  30. Offline

    Pantheis

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    That looks absolutely perfect. I would literally jump with glee to have the ability to configure things like that.
  31. Offline

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    :) Great, because it's in version 1.7 that I've just uploaded now.
    Pantheis likes this.
  32. Offline

    toadmess

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Version 1.7 now available for download. It has two main changes:
    - "trialTNTFuseMultiplier" is now called just "tntFuseMultiplier"
    - the "yieldSpecific" property allows different yields to be configured for different block types

    This version has had a huge internal restructure, so please do let me know about any bugs!

    I'm still working on player triggered TNT configs, permissions configs, and charged creeper configs. These look likely to come in the next release.

    The different configs for TNT triggered by explosions, redstone, and fire is proving more substantial a change than I had anticipated, but I'm still working on it.

Share This Page