Skip to content

Commit

Permalink
Attempt to make CodeFactor happier
Browse files Browse the repository at this point in the history
Move some stuff around to try and make CodeFactor happier.
  • Loading branch information
AnonymousHacker1279 committed Apr 15, 2022
1 parent 2cfbac0 commit e77ddeb
Showing 1 changed file with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@

public class BlockModelGenerator {

final Consumer<BlockStateGenerator> blockStateOutput;
final BiConsumer<ResourceLocation, Supplier<JsonElement>> modelOutput;
private final Consumer<BlockStateGenerator> blockStateOutput;
private final BiConsumer<ResourceLocation, Supplier<JsonElement>> modelOutput;
private final Consumer<Item> skippedAutoModelsOutput;

final List<Block> nonOrientableTrapdoor = ImmutableList.of(Blocks.OAK_TRAPDOOR, Blocks.DARK_OAK_TRAPDOOR,
private final List<Block> nonOrientableTrapdoor = ImmutableList.of(Blocks.OAK_TRAPDOOR, Blocks.DARK_OAK_TRAPDOOR,
Blocks.IRON_TRAPDOOR);

final Map<Block, BlockStateGeneratorSupplier> fullBlockModelCustomGenerators = ImmutableMap.<Block, BlockStateGeneratorSupplier> builder()
private final Map<Block, BlockStateGeneratorSupplier> fullBlockModelCustomGenerators = ImmutableMap.<Block, BlockStateGeneratorSupplier> builder()
.put(Blocks.STONE, BlockModelGenerator::createMirroredCubeGenerator)
.put(Blocks.DEEPSLATE, BlockModelGenerator::createMirroredColumnGenerator).build();

final Map<Block, TexturedModel> texturedModels = ImmutableMap.<Block, TexturedModel> builder().build();
private final Map<Block, TexturedModel> texturedModels = ImmutableMap.<Block, TexturedModel> builder().build();

public BlockModelGenerator(Consumer<BlockStateGenerator> pBlockStateOutput, BiConsumer<ResourceLocation,
Supplier<JsonElement>> pModelOutput, Consumer<Item> pSkippedAutoModelsOutput) {
Expand Down Expand Up @@ -181,7 +181,7 @@ static MultiVariantGenerator createSimpleBlock(Block pBlock, ResourceLocation pM
return MultiVariantGenerator.multiVariant(pBlock, Variant.variant().with(VariantProperties.MODEL, pModelLocation));
}

void createDoor(Block pDoorBlock) {
private void createDoor(Block pDoorBlock) {
TextureMapping door = TextureMapping.door(pDoorBlock);
ResourceLocation resourceLocation = ModelTemplates.DOOR_BOTTOM.create(pDoorBlock, door, modelOutput);
ResourceLocation resourceLocation1 = ModelTemplates.DOOR_BOTTOM_HINGE.create(pDoorBlock, door, modelOutput);
Expand Down Expand Up @@ -238,7 +238,7 @@ private static BlockStateGenerator createDoor(Block pDoorBlock, ResourceLocation
DoubleBlockHalf.UPPER, pTopHalfModelLocation, pTopHalfRightHingeModelLocation));
}

void createSimpleFlatItemModel(Item pFlatItem) {
private void createSimpleFlatItemModel(Item pFlatItem) {
ModelTemplates.FLAT_ITEM.create(ModelLocationUtils.getModelLocation(pFlatItem), TextureMapping.layer0(pFlatItem),
modelOutput);
}
Expand Down Expand Up @@ -309,7 +309,7 @@ void createSimpleFlatItemModel(Item pFlatItem) {
.with(VariantProperties.Y_ROT, VariantProperties.Rotation.R180));
}

static BlockStateGenerator createAxisAlignedPillarBlock(Block pAxisAlignedPillarBlock, ResourceLocation pModelLocation) {
private static BlockStateGenerator createAxisAlignedPillarBlock(Block pAxisAlignedPillarBlock, ResourceLocation pModelLocation) {
return MultiVariantGenerator.multiVariant(pAxisAlignedPillarBlock, Variant.variant()
.with(VariantProperties.MODEL, pModelLocation)).with(createRotatedPillar());
}
Expand All @@ -321,7 +321,7 @@ private static PropertyDispatch createRotatedPillar() {
.with(VariantProperties.Y_ROT, VariantProperties.Rotation.R90));
}

static BlockStateGenerator createRotatedPillarWithHorizontalVariant(Block pRotatedPillarBlock, ResourceLocation pModelLocation
private static BlockStateGenerator createRotatedPillarWithHorizontalVariant(Block pRotatedPillarBlock, ResourceLocation pModelLocation
, ResourceLocation pHorizontalModelLocation) {
return MultiVariantGenerator.multiVariant(pRotatedPillarBlock)
.with(PropertyDispatch.property(BlockStateProperties.AXIS)
Expand All @@ -338,12 +338,12 @@ private WoodProvider woodProvider(Block pLogBlock) {
return new WoodProvider(TextureMapping.logColumn(pLogBlock));
}

void delegateItemModel(Block pBlock, ResourceLocation pDelegateModelLocation) {
private void delegateItemModel(Block pBlock, ResourceLocation pDelegateModelLocation) {
modelOutput.accept(ModelLocationUtils.getModelLocation(pBlock.asItem()), new DelegatedModel(pDelegateModelLocation));
}

static BlockStateGenerator createButton(Block pButtonBlock, ResourceLocation pUnpoweredModelLocation,
ResourceLocation pPoweredModelLocation) {
private static BlockStateGenerator createButton(Block pButtonBlock, ResourceLocation pUnpoweredModelLocation,
ResourceLocation pPoweredModelLocation) {

return MultiVariantGenerator.multiVariant(pButtonBlock)
.with(PropertyDispatch.property(BlockStateProperties.POWERED)
Expand Down Expand Up @@ -401,8 +401,8 @@ static BlockStateGenerator createButton(Block pButtonBlock, ResourceLocation pUn
.with(VariantProperties.X_ROT, VariantProperties.Rotation.R180)));
}

static BlockStateGenerator createWall(Block pWallBlock, ResourceLocation pPostModelLocation,
ResourceLocation pLowSideModelLocation, ResourceLocation pTallSideModelLocation) {
private static BlockStateGenerator createWall(Block pWallBlock, ResourceLocation pPostModelLocation,
ResourceLocation pLowSideModelLocation, ResourceLocation pTallSideModelLocation) {

return MultiPartGenerator.multiPart(pWallBlock)
.with(Condition.condition().term(BlockStateProperties.UP, true),
Expand Down Expand Up @@ -448,8 +448,8 @@ static BlockStateGenerator createWall(Block pWallBlock, ResourceLocation pPostMo
.with(VariantProperties.UV_LOCK, true));
}

static BlockStateGenerator createFence(Block pFenceBlock, ResourceLocation pFencePostModelLocation,
ResourceLocation pFenceSideModelLocation) {
private static BlockStateGenerator createFence(Block pFenceBlock, ResourceLocation pFencePostModelLocation,
ResourceLocation pFenceSideModelLocation) {

return MultiPartGenerator.multiPart(pFenceBlock)
.with(Variant.variant()
Expand All @@ -474,10 +474,10 @@ static BlockStateGenerator createFence(Block pFenceBlock, ResourceLocation pFenc
.with(VariantProperties.UV_LOCK, true));
}

static BlockStateGenerator createFenceGate(Block pFenceGateBlock, ResourceLocation pOpenModelLocation,
ResourceLocation pClosedModelLocation,
ResourceLocation pWallOpenModelLocation,
ResourceLocation pWallClosedModelLocation) {
private static BlockStateGenerator createFenceGate(Block pFenceGateBlock, ResourceLocation pOpenModelLocation,
ResourceLocation pClosedModelLocation,
ResourceLocation pWallOpenModelLocation,
ResourceLocation pWallClosedModelLocation) {

return MultiVariantGenerator.multiVariant(pFenceGateBlock,
Variant.variant()
Expand Down Expand Up @@ -512,8 +512,8 @@ private static PropertyDispatch createHorizontalFacingDispatchAlt() {
.with(VariantProperties.Y_ROT, VariantProperties.Rotation.R270));
}

static BlockStateGenerator createPressurePlate(Block pPressurePlateBlock, ResourceLocation pUnpoweredModelLocation,
ResourceLocation pPoweredModelLocation) {
private static BlockStateGenerator createPressurePlate(Block pPressurePlateBlock, ResourceLocation pUnpoweredModelLocation,
ResourceLocation pPoweredModelLocation) {

return MultiVariantGenerator.multiVariant(pPressurePlateBlock)
.with(createBooleanModelDispatch(BlockStateProperties.POWERED, pPoweredModelLocation,
Expand All @@ -530,12 +530,12 @@ private static PropertyDispatch createBooleanModelDispatch(BooleanProperty pProp
.select(false, Variant.variant().with(VariantProperties.MODEL, pFalseModelLocation));
}

void skipAutoItemBlock(Block pBlock) {
private void skipAutoItemBlock(Block pBlock) {
skippedAutoModelsOutput.accept(pBlock.asItem());
}

static BlockStateGenerator createSlab(Block pSlabBlock, ResourceLocation pBottomHalfModelLocation,
ResourceLocation pTopHalfModelLocation, ResourceLocation pDoubleModelLocation) {
private static BlockStateGenerator createSlab(Block pSlabBlock, ResourceLocation pBottomHalfModelLocation,
ResourceLocation pTopHalfModelLocation, ResourceLocation pDoubleModelLocation) {

return MultiVariantGenerator.multiVariant(pSlabBlock)
.with(PropertyDispatch.property(BlockStateProperties.SLAB_TYPE)
Expand All @@ -550,9 +550,9 @@ static BlockStateGenerator createSlab(Block pSlabBlock, ResourceLocation pBottom
.with(VariantProperties.MODEL, pDoubleModelLocation)));
}

static BlockStateGenerator createStairs(Block pStairsBlock, ResourceLocation pInnerModelLocation,
ResourceLocation pStraightModelLocation,
ResourceLocation pOuterModelLocation) {
private static BlockStateGenerator createStairs(Block pStairsBlock, ResourceLocation pInnerModelLocation,
ResourceLocation pStraightModelLocation,
ResourceLocation pOuterModelLocation) {

return MultiVariantGenerator.multiVariant(pStairsBlock)
.with(PropertyDispatch
Expand Down Expand Up @@ -765,7 +765,7 @@ static BlockStateGenerator createStairs(Block pStairsBlock, ResourceLocation pIn
.with(VariantProperties.UV_LOCK, true)));
}

void createTrapdoor(Block pTrapdoorBlock) {
private void createTrapdoor(Block pTrapdoorBlock) {
TextureMapping textureMapping = TextureMapping.defaultTexture(pTrapdoorBlock);
ResourceLocation resourceLocation = ModelTemplates.TRAPDOOR_TOP.create(pTrapdoorBlock, textureMapping, modelOutput);
ResourceLocation resourceLocation1 = ModelTemplates.TRAPDOOR_BOTTOM.create(pTrapdoorBlock, textureMapping, modelOutput);
Expand Down Expand Up @@ -837,7 +837,7 @@ private static BlockStateGenerator createTrapdoor(Block pTrapdoorBlock, Resource
.with(VariantProperties.Y_ROT, VariantProperties.Rotation.R270)));
}

void createOrientableTrapdoor(Block pOrientableTrapdoorBlock) {
private void createOrientableTrapdoor(Block pOrientableTrapdoorBlock) {
TextureMapping textureMapping = TextureMapping.defaultTexture(pOrientableTrapdoorBlock);
ResourceLocation resourceLocation = ModelTemplates.ORIENTABLE_TRAPDOOR_TOP
.create(pOrientableTrapdoorBlock, textureMapping, modelOutput);
Expand Down

0 comments on commit e77ddeb

Please sign in to comment.