-
-
Notifications
You must be signed in to change notification settings - Fork 337
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
Style/codacity style fixes #2078
Conversation
@@ -400,7 +400,7 @@ public BuildingWareHouse getWareHouse() | |||
*/ | |||
private AIState deliver() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -296,7 +297,7 @@ private static StructureWrapper loadStructure( | |||
*/ | |||
public Structure(final World targetWorld, final StructureWrapper structure, final Stage stageProgress) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -310,7 +310,7 @@ public String getJobName() | |||
public void serializeToView(@NotNull final ByteBuf buf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -381,7 +381,7 @@ private StandardRequestFactories() | |||
{ | |||
} | |||
|
|||
public static <T extends IRequestable> NBTTagCompound serializeToNBT(IFactoryController controller, IRequest<T> request, IObjectToNBTConverter<T> typeSerialization) | |||
public static <T extends IRequestable> NBTTagCompound serializeToNBT(final IFactoryController controller, final IRequest<T> request, final IObjectToNBTConverter<T> typeSerialization) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -51,11 +51,11 @@ public StandardPlayerRequestResolver getNewInstance( | |||
@NotNull final Object... context) | |||
throws IllegalArgumentException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -51,11 +51,11 @@ public StandardPlayerRequestResolver getNewInstance( | |||
@NotNull final Object... context) | |||
throws IllegalArgumentException | |||
{ | |||
ILocation location; | |||
final ILocation location; | |||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed XD
try { | ||
location = | ||
factoryController.getNewInstance(TypeConstants.ILOCATION, iRequestManager.getColony().getCenter(), iRequestManager.getColony().getWorld().provider.getDimension()); | ||
} catch (Exception ex) | ||
} catch (final Exception ex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please
try { | ||
location = | ||
factoryController.getNewInstance(TypeConstants.ILOCATION, iRequestManager.getColony().getCenter(), iRequestManager.getColony().getWorld().provider.getDimension()); | ||
} catch (Exception ex) | ||
} catch (final Exception ex) | ||
{ | ||
throw ex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -810,7 +810,7 @@ public static void addToZipFile(final String fileName, final ZipOutputStream zos | |||
Files.copy(file, zos); | |||
fis.close(); | |||
} | |||
catch (Exception e) | |||
catch (final Exception e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -332,7 +332,7 @@ public ColonyView getColony() | |||
public <R> ImmutableList<IRequest<? extends R>> getOpenRequestsOfTypeFiltered( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int i = 222; | ||
int j = 114; | ||
final int i = 222; | ||
final int j = 114; | ||
this.inventoryRows = containerMinecoloniesBuildingInventory.getLowerChestInventory().getSizeInventory() / 9; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int i = 222; | ||
int j = 114; | ||
final int i = 222; | ||
final int j = 114; | ||
this.inventoryRows = containerMinecoloniesBuildingInventory.getLowerChestInventory().getSizeInventory() / 9; | ||
this.ySize = 114 + this.inventoryRows * 18; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int i = (this.width - this.xSize) / 2; | ||
int j = (this.height - this.ySize) / 2; | ||
final int i = (this.width - this.xSize) / 2; | ||
final int j = (this.height - this.ySize) / 2; | ||
this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.inventoryRows * 18 + 17); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int i = (this.width - this.xSize) / 2; | ||
int j = (this.height - this.ySize) / 2; | ||
final int i = (this.width - this.xSize) / 2; | ||
final int j = (this.height - this.ySize) / 2; | ||
this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.inventoryRows * 18 + 17); | ||
this.drawTexturedModalRect(i, j + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assign this magic number 18 to a well-named constant, and use the constant instead.
Assign this magic number 17 to a well-named constant, and use the constant instead.
Assign this magic number 126 to a well-named constant, and use the constant instead.
Assign this magic number 96 to a well-named constant, and use the constant instead.
this.inventoryRows = containerMinecoloniesBuildingInventory.getLowerChestInventory().getSizeInventory() / 9; | ||
this.ySize = 114 + this.inventoryRows * 18; | ||
} | ||
|
||
/** | ||
* Draw the foreground layer for the GuiContainer (everything in front of the items) | ||
*/ | ||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) | ||
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) | ||
{ | ||
this.fontRenderer.drawString(this.lowerChestInventory.getDisplayName().getUnformattedText(), 8, 6, 4210752); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assign this magic number 8 to a well-named constant, and use the constant instead.
Assign this magic number 6 to a well-named constant, and use the constant instead.
Assign this magic number 4210752 to a well-named constant, and use the constant instead.
Add underscores to this numeric value for readability
this.inventoryRows = containerMinecoloniesBuildingInventory.getLowerChestInventory().getSizeInventory() / 9; | ||
this.ySize = 114 + this.inventoryRows * 18; | ||
} | ||
|
||
/** | ||
* Draw the foreground layer for the GuiContainer (everything in front of the items) | ||
*/ | ||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) | ||
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) | ||
{ | ||
this.fontRenderer.drawString(this.lowerChestInventory.getDisplayName().getUnformattedText(), 8, 6, 4210752); | ||
this.fontRenderer.drawString(this.upperChestInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 96 + 2, 4210752); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assign this magic number 8 to a well-named constant, and use the constant instead.
Assign this magic number 96 to a well-named constant, and use the constant instead.
Assign this magic number 4210752 to a well-named constant, and use the constant instead.
Add underscores to this numeric value for readability
@@ -27,16 +27,16 @@ public GuiMinecoloniesBuildingInventory(final ContainerMinecoloniesBuildingInven | |||
this.upperChestInventory = containerMinecoloniesBuildingInventory.getPlayerInventory(); | |||
this.lowerChestInventory = containerMinecoloniesBuildingInventory.getLowerChestInventory(); | |||
this.allowUserInput = false; | |||
int i = 222; | |||
int j = 114; | |||
final int i = 222; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we aren't removing them could we name them better ( including the j
variable)
int i = 222; | ||
int j = 114; | ||
final int i = 222; | ||
final int j = 114; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -91,15 +91,15 @@ public void resolve(@NotNull final IRequestManager manager, @NotNull final IRequ | |||
((BuildingBasedRequester) request.getRequester()).getBuilding().isPresent() && | |||
((BuildingBasedRequester) request.getRequester()).getBuilding().get() instanceof AbstractBuilding) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -96,9 +96,9 @@ public boolean canResolve( | |||
public void resolve( | |||
@NotNull final IRequestManager manager, @NotNull final IRequest<? extends IDeliverable> request) throws RuntimeException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -116,7 +116,7 @@ public void resolve( | |||
private AbstractBuilding getBuildingFromRequest( | |||
@NotNull final IRequestManager manager, @NotNull final IRequest<? extends IDeliverable> request) throws RuntimeException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -76,10 +76,10 @@ public boolean canResolve(@NotNull final IRequestManager manager, final IRequest | |||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -473,7 +473,7 @@ private AIState lookForRequests() | |||
final ImmutableList<IRequest> completedRequests = getOwnBuilding().getCompletedRequests(worker.getCitizenData()); | |||
|
|||
completedRequests.stream().filter(r -> !(r.canBeDelivered())).forEach(r -> getOwnBuilding().markRequestAsAccepted(worker.getCitizenData(), r.getToken())); | |||
IRequest firstDeliverableRequest = completedRequests.stream().filter(r -> r.canBeDelivered()).findFirst().orElse(null); | |||
final IRequest firstDeliverableRequest = completedRequests.stream().filter(r -> r.canBeDelivered()).findFirst().orElse(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we set the sonar.java.source
please? @OrionDevelopment
@@ -796,7 +796,7 @@ public void serializeViewNetworkData(@NotNull final ByteBuf buf) | |||
|
|||
buf.writeInt(colony.getID()); | |||
|
|||
NBTTagCompound compound = new NBTTagCompound(); | |||
final NBTTagCompound compound = new NBTTagCompound(); | |||
compound.setTag("inventory", inventory.writeToNBT(new NBTTagList())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -15,7 +15,7 @@ | |||
protected ScrollingContainer container; | |||
protected Scrollbar scrollbar; | |||
// Params | |||
private int scrollbarWidth = DEFAULT_SCROLLBAR_WIDTH; | |||
private final int scrollbarWidth = DEFAULT_SCROLLBAR_WIDTH; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int i = 222; | ||
int j = 114; | ||
final int i = 222; | ||
final int j = 114; | ||
this.inventoryRows = containerMinecoloniesBuildingInventory.getLowerChestInventory().getSizeInventory() / 9; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int i = 222; | ||
int j = 114; | ||
final int i = 222; | ||
final int j = 114; | ||
this.inventoryRows = containerMinecoloniesBuildingInventory.getLowerChestInventory().getSizeInventory() / 9; | ||
this.ySize = 114 + this.inventoryRows * 18; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int i = (this.width - this.xSize) / 2; | ||
int j = (this.height - this.ySize) / 2; | ||
final int i = (this.width - this.xSize) / 2; | ||
final int j = (this.height - this.ySize) / 2; | ||
this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.inventoryRows * 18 + 17); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int i = (this.width - this.xSize) / 2; | ||
int j = (this.height - this.ySize) / 2; | ||
final int i = (this.width - this.xSize) / 2; | ||
final int j = (this.height - this.ySize) / 2; | ||
this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.inventoryRows * 18 + 17); | ||
this.drawTexturedModalRect(i, j + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assign this magic number 18 to a well-named constant, and use the constant instead.
Assign this magic number 17 to a well-named constant, and use the constant instead.
Assign this magic number 126 to a well-named constant, and use the constant instead.
Assign this magic number 96 to a well-named constant, and use the constant instead.
this.inventoryRows = containerMinecoloniesBuildingInventory.getLowerChestInventory().getSizeInventory() / 9; | ||
this.ySize = 114 + this.inventoryRows * 18; | ||
} | ||
|
||
/** | ||
* Draw the foreground layer for the GuiContainer (everything in front of the items) | ||
*/ | ||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) | ||
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) | ||
{ | ||
this.fontRenderer.drawString(this.lowerChestInventory.getDisplayName().getUnformattedText(), 8, 6, 4210752); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assign this magic number 8 to a well-named constant, and use the constant instead.
Assign this magic number 6 to a well-named constant, and use the constant instead.
Assign this magic number 4210752 to a well-named constant, and use the constant instead.
Add underscores to this numeric value for readability
this.inventoryRows = containerMinecoloniesBuildingInventory.getLowerChestInventory().getSizeInventory() / 9; | ||
this.ySize = 114 + this.inventoryRows * 18; | ||
} | ||
|
||
/** | ||
* Draw the foreground layer for the GuiContainer (everything in front of the items) | ||
*/ | ||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) | ||
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) | ||
{ | ||
this.fontRenderer.drawString(this.lowerChestInventory.getDisplayName().getUnformattedText(), 8, 6, 4210752); | ||
this.fontRenderer.drawString(this.upperChestInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 96 + 2, 4210752); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assign this magic number 8 to a well-named constant, and use the constant instead.
Assign this magic number 96 to a well-named constant, and use the constant instead.
Assign this magic number 4210752 to a well-named constant, and use the constant instead.
Add underscores to this numeric value for readability
@@ -27,16 +27,16 @@ public GuiMinecoloniesCitizenInventory(final ContainerMinecoloniesCitizenInvento | |||
this.upperChestInventory = containerMinecoloniesBuildingInventory.getPlayerInventory(); | |||
this.lowerChestInventory = containerMinecoloniesBuildingInventory.getLowerChestInventory(); | |||
this.allowUserInput = false; | |||
int i = 222; | |||
int j = 114; | |||
final int i = 222; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above comment
int i = 222; | ||
int j = 114; | ||
final int i = 222; | ||
final int j = 114; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -90,7 +90,7 @@ public boolean canResolve( | |||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good to me, will approve once i've got responses
@@ -1376,14 +1376,14 @@ private ItemStack forceItemStackToProvider(@NotNull final ICapabilityProvider pr | |||
*/ | |||
public void setMirror() | |||
{ | |||
this.isMirrored = !isMirrored; | |||
this.isBuildingMirrored = !isBuildingMirrored; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this method be invertMirror
or something? or make it setMirror(final boolean isMirrored)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea =)
@@ -51,11 +51,11 @@ public StandardPlayerRequestResolver getNewInstance( | |||
@NotNull final Object... context) | |||
throws IllegalArgumentException | |||
{ | |||
ILocation location; | |||
final ILocation location; | |||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed XD
try { | ||
location = | ||
factoryController.getNewInstance(TypeConstants.ILOCATION, iRequestManager.getColony().getCenter(), iRequestManager.getColony().getWorld().provider.getDimension()); | ||
} catch (Exception ex) | ||
} catch (final Exception ex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please
@@ -473,7 +473,7 @@ private AIState lookForRequests() | |||
final ImmutableList<IRequest> completedRequests = getOwnBuilding().getCompletedRequests(worker.getCitizenData()); | |||
|
|||
completedRequests.stream().filter(r -> !(r.canBeDelivered())).forEach(r -> getOwnBuilding().markRequestAsAccepted(worker.getCitizenData(), r.getToken())); | |||
IRequest firstDeliverableRequest = completedRequests.stream().filter(r -> r.canBeDelivered()).findFirst().orElse(null); | |||
final IRequest firstDeliverableRequest = completedRequests.stream().filter(r -> r.canBeDelivered()).findFirst().orElse(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we set the sonar.java.source
please? @OrionDevelopment
} | ||
return false; | ||
return InventoryUtils.transferXOfFirstSlotInProviderWithIntoNextFreeSlotInItemHandler( | ||
(ICapabilityProvider) world.getTileEntity(pos), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are we guaranteeing that we can convert these two? (are tile entities always ICapabilityProviders?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah
@@ -27,16 +27,16 @@ public GuiMinecoloniesBuildingInventory(final ContainerMinecoloniesBuildingInven | |||
this.upperChestInventory = containerMinecoloniesBuildingInventory.getPlayerInventory(); | |||
this.lowerChestInventory = containerMinecoloniesBuildingInventory.getLowerChestInventory(); | |||
this.allowUserInput = false; | |||
int i = 222; | |||
int j = 114; | |||
final int i = 222; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we aren't removing them could we name them better ( including the j
variable)
@@ -27,16 +27,16 @@ public GuiMinecoloniesCitizenInventory(final ContainerMinecoloniesCitizenInvento | |||
this.upperChestInventory = containerMinecoloniesBuildingInventory.getPlayerInventory(); | |||
this.lowerChestInventory = containerMinecoloniesBuildingInventory.getLowerChestInventory(); | |||
this.allowUserInput = false; | |||
int i = 222; | |||
int j = 114; | |||
final int i = 222; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above comment
The rest of the issues are for another day =D
…On Jan 22, 2018 11:38 PM, "Asherslab" ***@***.***> wrote:
***@***.**** commented on this pull request.
Looks pretty good to me, will approve once i've got responses
------------------------------
In src/main/java/com/minecolonies/coremod/colony/
buildings/AbstractBuilding.java
<#2078 (comment)>
:
> @@ -1376,14 +1376,14 @@ private ItemStack ***@***.*** final ICapabilityProvider pr
*/
public void setMirror()
{
- this.isMirrored = !isMirrored;
+ this.isBuildingMirrored = !isBuildingMirrored;
shouldn't this method be invertMirror or something? or make it setMirror(final
boolean isMirrored) ?
------------------------------
In src/main/java/com/minecolonies/coremod/colony/requestsystem/resolvers/
factory/StandardPlayerRequestResolverFactory.java
<#2078 (comment)>
:
> @@ -51,11 +51,11 @@ public StandardPlayerRequestResolver getNewInstance(
@NotNull final Object... context)
throws IllegalArgumentException
{
- ILocation location;
+ final ILocation location;
try {
Agreed XD
------------------------------
In src/main/java/com/minecolonies/coremod/colony/requestsystem/resolvers/
factory/StandardPlayerRequestResolverFactory.java
<#2078 (comment)>
:
> try {
location =
factoryController.getNewInstance(TypeConstants.ILOCATION, iRequestManager.getColony().getCenter(), iRequestManager.getColony().getWorld().provider.getDimension());
- } catch (Exception ex)
+ } catch (final Exception ex)
Please
------------------------------
In src/main/java/com/minecolonies/coremod/entity/ai/basic/
AbstractEntityAIBasic.java
<#2078 (comment)>
:
> @@ -473,7 +473,7 @@ private AIState lookForRequests()
final ImmutableList<IRequest> completedRequests = getOwnBuilding().getCompletedRequests(worker.getCitizenData());
completedRequests.stream().filter(r -> !(r.canBeDelivered())).forEach(r -> getOwnBuilding().markRequestAsAccepted(worker.getCitizenData(), r.getToken()));
- IRequest firstDeliverableRequest = completedRequests.stream().filter(r -> r.canBeDelivered()).findFirst().orElse(null);
+ final IRequest firstDeliverableRequest = completedRequests.stream().filter(r -> r.canBeDelivered()).findFirst().orElse(null);
can we set the sonar.java.source please? @OrionDevelopment
<https://github.com/oriondevelopment>
------------------------------
In src/main/java/com/minecolonies/coremod/entity/ai/basic/
AbstractEntityAIBasic.java
<#2078 (comment)>
:
> @@ -1240,15 +1240,10 @@ public boolean ***@***.*** final ItemStack
*/
public boolean tryTransferFromPosToWorker(final BlockPos pos, @NotNull final Predicate<ItemStack> predicate)
{
- final TileEntity entity = world.getTileEntity(pos);
- if (entity.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.DOWN))
- {
- return InventoryUtils.transferXOfFirstSlotInItemHandlerWithIntoNextFreeSlotInItemHandler(
- new InvWrapper((IInventory) entity),
- predicate,
- Constants.STACKSIZE,
- new InvWrapper(worker.getInventoryCitizen()));
- }
- return false;
+ return InventoryUtils.transferXOfFirstSlotInProviderWithIntoNextFreeSlotInItemHandler(
+ (ICapabilityProvider) world.getTileEntity(pos),
How are we guaranteeing that we can convert these two? (are tile entities
always ICapabilityProviders?)
------------------------------
In src/main/java/com/minecolonies/coremod/inventory/
GuiMinecoloniesBuildingInventory.java
<#2078 (comment)>
:
> @@ -27,16 +27,16 @@ public GuiMinecoloniesBuildingInventory(final ContainerMinecoloniesBuildingInven
this.upperChestInventory = containerMinecoloniesBuildingInventory.getPlayerInventory();
this.lowerChestInventory = containerMinecoloniesBuildingInventory.getLowerChestInventory();
this.allowUserInput = false;
- int i = 222;
- int j = 114;
+ final int i = 222;
if we aren't removing them could we name them better ( including the j
variable)
------------------------------
In src/main/java/com/minecolonies/coremod/inventory/
GuiMinecoloniesCitizenInventory.java
<#2078 (comment)>
:
> @@ -27,16 +27,16 @@ public GuiMinecoloniesCitizenInventory(final ContainerMinecoloniesCitizenInvento
this.upperChestInventory = containerMinecoloniesBuildingInventory.getPlayerInventory();
this.lowerChestInventory = containerMinecoloniesBuildingInventory.getLowerChestInventory();
this.allowUserInput = false;
- int i = 222;
- int j = 114;
+ final int i = 222;
Same as above comment
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2078 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGI9y0m9shP4uGgCugfxlBOmgoL2Jt85ks5tNTgGgaJpZM4Ro1nQ>
.
|
@@ -90,7 +90,7 @@ public boolean canResolve( | |||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SonarQube analysis reported 342 issues Watch the comments in this conversation to review them. Top 10 extra issuesNote: 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:
|
* Fixes one exception Code cleanup
* Fixes one exception Code cleanup
* Style/codacity style fixes (#2078) * Fixes one exception Code cleanup * fix 1.10 related things
Fixes several codacity style issues.
Review please