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

P2P tunnel frequency colors #3610

Merged
merged 8 commits into from Jul 14, 2018

Conversation

Projects
None yet
2 participants
@fscan
Member

fscan commented Jul 12, 2018

First attempt at coloring the tunnel parts with the frequency.
Not sure about the IPartBakedModel, but we have to somehow pass the renderstate flags to the baked model.

@fscan fscan added this to the rv6.alpha - 1.12 milestone Jul 12, 2018

import net.minecraft.client.renderer.block.model.BakedQuad;
public interface IPartBakedModel

This comment has been minimized.

@orod-org

orod-org Jul 12, 2018

CRITICAL Annotate the "IPartBakedModel" interface with the @FunctionalInterface annotation rule

@@ -119,7 +120,15 @@
throw new IllegalStateException( "Trying to use an unregistered part model: " + model );
}
List<BakedQuad> partQuads = bakedModel.getQuads( state, null, rand );
List<BakedQuad> partQuads;
if( bakedModel instanceof IPartBakedModel )

This comment has been minimized.

@orod-org

orod-org Jul 12, 2018

CRITICAL Refactor this code to not nest more than 3 if/for/while/switch/try statements. rule

@@ -190,7 +198,7 @@ public boolean equals( Object obj )
return this.cableColor == other.cableColor && this.cableType == other.cableType && this.coreType == other.coreType && Objects

This comment has been minimized.

@orod-org

orod-org Jul 12, 2018

CRITICAL Reduce the number of conditional operators (7) used in the expression (maximum allowed 3). rule

@@ -154,6 +156,11 @@ public void setCableBusAdjacent( EnumSet<EnumFacing> cableBusAdjacent )
return this.boundingBoxes;
}
public EnumMap<EnumFacing, Long> getPartFlags()

This comment has been minimized.

@orod-org

orod-org Jul 12, 2018

MINOR The return type of this method should be an interface such as "Map" rather than the implementation "EnumMap". rule

}
catch( Exception e )
{
throw new RuntimeException( e );

This comment has been minimized.

@orod-org

orod-org Jul 12, 2018

MAJOR Define and throw a dedicated exception instead of using a generic one. rule

@fscan

This comment has been minimized.

Member

fscan commented Jul 12, 2018

2018-07-12_18 27 01

@fscan

This comment has been minimized.

Member

fscan commented Jul 13, 2018

2018-07-13_01 41 17

}
else
{
final float cv[] = c.dye.getColorComponentValues();

This comment has been minimized.

@orod-org

orod-org Jul 13, 2018

MINOR Move the array designator from the variable to the type. rule

return getQuadsForFrequency( frequency, active );
} );
}
catch( ExecutionException e )

This comment has been minimized.

@orod-org

orod-org Jul 13, 2018

MAJOR Either log or rethrow this exception. rule

private final VertexFormat format;
private final TextureAtlasSprite texture;
private final static Cache<Long, List<BakedQuad>> modelCache = CacheBuilder.newBuilder().maximumSize( 100 ).build();

This comment has been minimized.

@orod-org

orod-org Jul 13, 2018

MINOR Reorder the modifiers to comply with the Java Language Specification. rule

final int startx = j % 2;
final int starty = 1 - j / 2;
cb.addCube( offs[0] + startx, offs[1] + starty, offs[2], offs[0] + startx + 1, offs[1] + starty + 1, offs[2] + 1 );

This comment has been minimized.

@orod-org

orod-org Jul 13, 2018

MINOR Cast one of the operands of this addition operation to a "float". rule
MINOR Cast one of the operands of this addition operation to a "float". rule
MINOR Cast one of the operands of this addition operation to a "float". rule
MINOR Cast one of the operands of this addition operation to a "float". rule
MINOR Cast one of the operands of this addition operation to a "float". rule

@orod-org

This comment has been minimized.

orod-org commented Jul 13, 2018

SonarQube analysis reported 24 issues

  • BLOCKER 3 blocker
  • CRITICAL 3 critical
  • MAJOR 6 major
  • MINOR 11 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 IPartBakedModel.java#: Add or update the header of this file. rule
  2. BLOCKER P2PTunnelFrequencyBakedModel.java#: Add or update the header of this file. rule
  3. BLOCKER P2PTunnelFrequencyModel.java#: Add or update the header of this file. rule
  4. MAJOR CableBusBakedModel.java#L154: Remove this unused method parameter "cableType". rule
  5. MAJOR CableBusContainer.java#L703: Remove this expression which always evaluates to "true" rule
  6. MAJOR PartP2PTunnel.java#L199: Rename "freq" which hides the field declared at line 61. rule
  7. MAJOR PartP2PTunnel.java#L237: Remove this expression which always evaluates to "true" rule
  8. MINOR IPart.java#L242: Redundant 'public' modifier. rule
  9. MINOR CableBusBakedModel.java#L365: Don't override a deprecated method or explicitly mark it as "@deprecated". rule
  10. MINOR p2p_tunnel_base.json#: Add an empty new line at the end of this file. rule

@fscan fscan merged commit 2891014 into rv6-1.12 Jul 14, 2018

3 of 4 checks passed

sonarqube SonarQube reported 24 issues, with 3 critical and 3 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 feature-p2p-tunnel-colors branch Jul 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment