Skip to content

Deblocking Block fields/methods #521

Closed

Description

@bs2609
  • Block:

    • field_149762_H: blockSoundType -> soundType
    • field_149763_I: blockParticleGravity -> particleGravity
    • field_149764_J: blockMaterial -> material
    • field_149781_w: blockResistance -> blastResistance
    • field_149782_v: blockHardness -> hardness
    • field_181083_K: blockMapColor -> mapColor ?
    • func_149722_s: setBlockUnbreakable -> setUnbreakable
    • func_176195_g: getBlockHardness -> getHardness
    • func_176206_d: onBlockDestroyedByPlayer -> onPlayerDestroy
    • func_180647_a: getPlayerRelativeBlockHardness -> getRelativeHardness
    • func_176226_b: dropBlockAsItem -> dropAsItem
    • func_180653_a: dropBlockAsItemWithChance -> dropAsItem
    • func_180637_b: dropXpOnBlockBreak -> dropExperience
    • func_180652_a: onBlockDestroyedByExplosion -> onExplosionDestroy
    • func_176198_a: canPlaceBlockOnSide -> canPlaceAgainstSide
    • func_176196_c: canPlaceBlockAt -> canPlaceAt
    • func_180639_a: onBlockActivated -> onActivation
    • func_180649_a: onBlockClicked -> onClick
    • func_180634_a: onEntityCollidedWithBlock -> onEntityCollision
    • func_181623_g: canSpawnInBlock -> allowsSpawning ?
  • IBlockProperties:

    • func_185887_b: getBlockHardness -> getHardness
    • func_185903_a: getPlayerRelativeBlockHardness -> getRelativeHardness

Leaving onBlockAdded/onBlockPlacedBy and harvestBlock/onBlockHarvested alone for now, as they're tricky enough as is.

Activity

  1. self-assigned this
    on Sep 19, 2017
  2. marvin-roesch commented on Sep 19, 2017

    @marvin-roesch
    Contributor

    Great suggestion in general, just two (or one?) minor nitpick: You go for onActivation but you kept the onDestroyedByX names. I'd say for conistency's sake that either the first one should be onActivated or the latter ones should be onDestructionByX.

  3. bs2609 commented on Sep 19, 2017

    @bs2609
    ContributorAuthor

    Didn't think of onDestruction at the time, which do you prefer?

  4. kashike commented on Sep 19, 2017

    @kashike
    Collaborator

    Another option is something like:

    • func_180639_a: onBlockActivated -> activated
    • func_180652_a: onBlockDestroyedByExplosion -> exploded
    • func_180649_a: onBlockClicked -> clicked
  5. marvin-roesch commented on Sep 19, 2017

    @marvin-roesch
    Contributor

    I think the noun makes more sense than the participle and the latter is in fact not even correct grammatically (I think 🤔). The only "problem" I could see is that the 'on' + participle form is used a lot for other methods already, but there doesn't appear to be any consistency (e.g. onItemUse vs onBlockAdded) anyways.
    I'd still go for the on prefix rather than omitting it like @kashike suggests, since you underline the 'event-ness' of the methods that way.

  6. covers1624 commented on Sep 19, 2017

    @covers1624

    I agree, the "event-ness" of the method names needs to be kept, It makes them sound more like a field without it.

  7. marvin-roesch commented on Sep 22, 2017

    @marvin-roesch
    Contributor

    I feel like this doesn't require a separate issue, so an additional suggestion:
    func_149634_a: getBlockFromItem -> fromItem/fromItemBlock
    I personally prefer the latter since people don't get illusions about magically getting the block from an item like that (especially for Vanilla things that inherit ItemBlockSpecial).

  8. kashike commented on Jul 13, 2018

    @kashike
    Collaborator
    • field_149764_J: blockMaterial -> material
    • func_180652_a: onBlockDestroyedByExplosion -> onExplosionDestroy
    • func_176206_d: onBlockDestroyedByPlayer -> onPlayerDestroy
    • func_180634_a: onEntityCollidedWithBlock -> onEntityCollision
    • field_149762_H: blockSoundType → soundType
  9. changed the title [-]Deblocking Block methods[/-] [+]Deblocking Block fields/methods[/+] on Aug 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions