Jump to content

[Usage Survey] onBlockDestroyedByExplosion


Recommended Posts

I'm doing a quick survey on how other devs use onBlockDestroyedByExplosion in there own work.


Who am I

I'm the current owner/developer of ICBM and head developer for Universal Electricity modding organization.


Why the survey

    I've been making an effort to reach out to more devs before assuming things. This way my work is well supported, handles how each dev does there own work, and is very flexable. In this case i'm working on increasing the functionality of the original ICBM mod while rewriting it from the ground up.


How to answer the survey

    Give the use case a quick name followed by what happens. Keep it short and generic so it can be applied to any block out side your own work. You do not need to explain why you code your block with the use in mind. Instead just say what the block does when the method is called and any related logic after the call.


  Your are not required to but feel free to list the mod, block/tile, and example code. This way other devs can use this thread to understand the same thing i'm working on. Mod name and blocks will only be used to compile a list per use case. Code will not be used without your permission and it is advised to list the code's copy right if it has one.


[h2]Use Cases[/h2]

    A use case is  a unique example of how something will work or be used. For those that have never used them they are widely used to help design how code will work. Mainly to plan out every realistic action the code should support. In this case the action is triggered by the block being removed by an explosion with or without item drops.


    Each case is either unique or a sub case of generic use case. While all uses cases are nice there is also a list of use cases that will end up being blocked. This is to prevent issue that most player do not like to see in mods. Mainly duplication of items and crashes due to assumptions made when creating blocks.


#1 Event Trigger

Any event fired to let other mods, blocks, entities, or object know the block has been destroyed. Example of this are mods that need the event to trigger an action for cleanup. Another example is an entity linked to the block that may be removed if the block is gone.


#2 Blow up

Explosive like blocks that trigger more removal of blocks. Example of these blocks are Minecraft's TNT, explosive+, icbm, and resonant induction's reactors.


#3 Visual Effects

Blocks that create effect when they are removed. For example generating particles of smoke or pixel to indicate the block is done.


#4 Block Placement

Blocks that turn into another block when destroyed by an explosive. Example of this are glass to glass fragments, stone bricks to cracked stone bricks, stone to cobble stone, or wood to mulch.


#5 Unique Item Drops

Blocks that drop special items when destroyed by explosives. A few mods do this to gain crafting items as an extra step in getting high level blocks.


#5 Normal Item Drops

Blocks that drop items or call the dropItem method when remove by explosives. In which the same items are drop as if it was removed by a player. This is actually something a block should never do as most explosives will call the dropItem method. This way result in duplicated items as a future warning to other devs. If any dev does this in there code they need to ensure that the dropItem method doesn't drop blocks as well. This can be done by adding a location based boolean HashMap<Vec3, boolean> or List<Vec3>


#6 Fragment Effects

Any block that creates entity projectiles to harm entities around the block. Examples are ICBM's explosives that turn blocks into shrapnel and generate shrapnel entities drop the explosive block.


#7 Spawn Entity

Blocks that create new entities when destroyed. I'm unsure of example of this as its not commonly done. However, depending on the entity i may skip calling the destroy method to save memory creating the entity. As the explosive can cause 1 to 1/2 Million points of damage to any entity it finds after destroying all blocks.


#8 Mutliblocks

Not entirely related to the method call but it is useful to know if a multiblock system will cause issues. I've run into several examples of mods assuming blocks exist. For example a mutliblock barrel/crate mod that uses vec3 to find its core block. In which it never checked if the tile exists but just cast right away to its assumed type. Causing both NPE and can't cast exceptions.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • ChemsXpress (https://chemsxpress.com): ChemsXpress is a platform specializing in the distribution of research chemicals and related products. It offers a wide range of substances for scientific and laboratory use, catering to researchers and professionals. BubatzLand (https://bubatzland.com): BubatzLand focuses on providing high-quality cannabis products. The site offers a variety of strains, edibles, and related accessories, aiming to serve the needs of cannabis enthusiasts and medicinal users. HalluShroom (https://hallushroom.com): HalluShroom specializes in the sale of psychedelic mushrooms and related products. It caters to individuals interested in exploring the benefits and experiences associated with psilocybin and other psychedelic substances. HighAsch (https://highasch.com): HighAsch offers a diverse range of cannabis products, including flowers, concentrates, and edibles. The site aims to provide premium-quality products to both recreational and medicinal users. KetaminHaus (https://ketaminhaus.com): KetaminHaus provides ketamine and related products for research and therapeutic use. The platform focuses on ensuring the availability of high-quality, safe, and effective ketamine for various applications. KokainLabor (https://kokainlabor.com): KokainLabor offers cocaine and other related substances. The site targets individuals seeking high-purity products for personal or research purposes, emphasizing quality and safety. MDPHPWelt (https://mdphpwelt.com): MDPHPWelt specializes in the distribution of MDPHP and other similar research chemicals. It aims to supply researchers with high-quality substances for scientific and experimental use. NembutaLabor (https://nembutalabor.com): NembutaLabor provides Nembutal (pentobarbital) and related products. The site focuses on supplying these substances for research and veterinary purposes, ensuring high standards of quality and safety. NembutalQuelle (https://nembutalquelle.com): NembutalQuelle is dedicated to offering Nembutal and similar barbiturates. It caters to researchers and professionals who require these substances for scientific, medical, or veterinary applications. JBSaves Ltda Brazil (https://jbsavesltdabrazil.com): JBSaves Ltda Brazil is involved in the food and agricultural industry, providing a variety of products and services related to food processing, distribution, and agricultural practices. Bello Alimentos Ltda (https://belloalimentosltda.com): Bello Alimentos Ltda offers a wide range of food products. The site focuses on high-quality, nutritious, and safe food items, catering to consumers and businesses in the food industry. São Salvador Alimentos (https://saosalvadoralimentoss.com): São Salvador Alimentos specializes in the production and distribution of food products. The site provides a variety of options aimed at meeting the dietary needs and preferences of diverse consumers. WietWereld (https://wietwereld.com): WietWereld is a platform dedicated to the cannabis community. It offers information, products, and resources related to cannabis cultivation, consumption, and culture. 14. BeuhParadise (https://beuhparadis.com): BeuhParadise offers a range of cannabis products, including flowers, edibles, and concentrates. The site aims to provide high-quality cannabis products to recreational and medicinal users, emphasizing purity and potency. 15. WietWereld (https://wietwereld.com): WietWereld is a comprehensive resource for cannabis enthusiasts. It provides products, cultivation guides, and community forums for those interested in cannabis culture and cultivation. GrasOase (https://grasoase.com): GrasOase specializes in cannabis products and accessories. The site offers a variety of strains, seeds, and related items for cannabis users, focusing on quality and customer satisfaction. https://chemsxpress.com/ https://bubatzland.com/ https://hallushroom.com/ https://highasch.com/ https://ketaminhaus.com/ https://kokainlabor.com/ https://mdphpwelt.com/ https://nembutalabor.com/ https://nembutalquelle.com/ https://jbsavesltdabrazil.com/ https://belloalimentosltda.com/ https://saosalvadoralimentoss.com/ https://wietwereld.com https://beuhparadis.com https://wietwereld.com https://grasoase.com/
    • For Example I have an Main Mod that adds new Content to Minecraft. But I'm using custom Classes etc. and I want it so that is an api integrated in the Main Mod but can be download seperately like an Module. Is this possible? If you need more Information just comment what you need to know ^^
    • Delete the config of this mod (config folder) and test it again   If there is no change, try other builds  
    • Add the full crash-report or latest.log (logs-folder) with sites like https://paste.ee/ and paste the link to it here
  • Topics

  • Create New...

Important Information

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