Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup oredict and entity registration #3605

Merged
merged 1 commit into from Jul 14, 2018
Merged

Cleanup oredict and entity registration #3605

merged 1 commit into from Jul 14, 2018

Conversation

@fscan
Copy link
Member

@fscan fscan commented Jul 10, 2018

Moves the registrations to the relevant forge events.
This removes the ore camouflage, which may be controversial. But this will go away anyways with 1.13 and the tag system.



@SubscribeEvent
public void registerEntities( RegistryEvent.Register<EntityEntry> event)

This comment has been minimized.

@orod-org

orod-org Jul 10, 2018

MINOR ')' is not preceded with whitespace. rule

@@ -199,11 +182,6 @@ public RayTraceResult getRTR()
@Override
public void postInit()

This comment has been minimized.

@orod-org

orod-org Jul 10, 2018

CRITICAL Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation. rule

@@ -85,30 +84,14 @@ public void preinit()
{
ModelLoaderRegistry.registerLoader( UVLModelLoader.INSTANCE );
}

RenderingRegistry.registerEntityRenderingHandler( EntityTinyTNTPrimed.class, manager -> new RenderTinyTNTPrimed( manager ) );

This comment has been minimized.

@orod-org

orod-org Jul 10, 2018

MINOR Replace this lambda with a method reference. rule

@@ -85,30 +84,14 @@ public void preinit()
{
ModelLoaderRegistry.registerLoader( UVLModelLoader.INSTANCE );
}

RenderingRegistry.registerEntityRenderingHandler( EntityTinyTNTPrimed.class, manager -> new RenderTinyTNTPrimed( manager ) );
RenderingRegistry.registerEntityRenderingHandler( EntityFloatingItem.class, manager -> new RenderFloatingItem( manager ) );

This comment has been minimized.

@orod-org

orod-org Jul 10, 2018

MINOR Replace this lambda with a method reference. rule

@@ -85,30 +84,14 @@ public void preinit()
{
ModelLoaderRegistry.registerLoader( UVLModelLoader.INSTANCE );
}

RenderingRegistry.registerEntityRenderingHandler( EntityTinyTNTPrimed.class, manager -> new RenderTinyTNTPrimed( manager ) );
RenderingRegistry.registerEntityRenderingHandler( EntityFloatingItem.class, manager -> new RenderFloatingItem( manager ) );
}

@Override
public void init()

This comment has been minimized.

@orod-org

orod-org Jul 10, 2018

CRITICAL Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation. rule

@@ -231,6 +237,16 @@ public ApiItems( FeatureFactory registry )
this.crystalSeed = registry.item( "crystal_seed", ItemCrystalSeed::new )
.features( AEFeature.CRYSTAL_SEEDS )
.rendering( new ItemCrystalSeedRendering() )
.bootstrap( item -> (IEntityRegistrationComponent) r ->
{

This comment has been minimized.

@orod-org

orod-org Jul 10, 2018

MINOR Remove useless curly braces around statement rule

@orod-org
Copy link

@orod-org orod-org commented Jul 10, 2018

SonarQube analysis reported 21 issues

  • BLOCKER 1 blocker
  • CRITICAL 8 critical
  • MAJOR 5 major
  • MINOR 6 minor
  • INFO 1 info

Watch the comments in this conversation to review them.

Top 10 extra issues

Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:

  1. BLOCKER IEntityRegistrationComponent.java#: Add or update the header of this file. rule
  2. CRITICAL ApiBlocks.java#L299: Define a constant instead of duplicating this literal "sky_stone_chest" 3 times. rule
  3. CRITICAL ApiBlocks.java#L368: Define a constant instead of duplicating this literal "quantum_ring" 3 times. rule
  4. CRITICAL ApiBlocks.java#L456: Define a constant instead of duplicating this literal "crafting_unit" 4 times. rule
  5. CRITICAL ApiBlocks.java#L468: Define a constant instead of duplicating this literal "crafting_storage" 4 times. rule
  6. CRITICAL ItemMaterial.java#L90: The Cyclomatic Complexity of this method "addCheckedInformation" is 11 which is greater than 10 authorized. rule
  7. CRITICAL ItemMaterial.java#L278: Refactor this code to not nest more than 3 if/for/while/switch/try statements. rule
  8. MAJOR Registration.java#L457: This block of commented-out lines of code should be removed. rule
  9. MAJOR ApiBlocks.java#L571: Call "Optional#isPresent()" before accessing the value. rule
  10. MAJOR ApiBlocks.java#L583: Call "Optional#isPresent()" before accessing the value. rule
@yueh yueh added this to the rv6.alpha - 1.12 milestone Jul 11, 2018
@fscan fscan merged commit 3363acb into rv6-1.12 Jul 14, 2018
3 of 4 checks passed
3 of 4 checks passed
sonarqube SonarQube reported 21 issues, with 8 critical and 1 blocker
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
jenkins Success
Details
@fscan fscan deleted the cleanup-registration branch Jul 14, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.