mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-23 21:49:49 +00:00
Remove redundant casts, unnecessary object creation, and string ==
This commit is contained in:
1 parent
100784b51b
commit
a4cd13282a
57 files changed
+180
-156
No files matched your search
@@ -9,7 +9,7 @@ import forestry.api.genetics.IClassification;
|
||||
class ControlBranchBox extends ControlListBox<IClassification> {
|
||||
@Override
|
||||
public IWidget createOption(final IClassification value, final int y) {
|
||||
return new ControlBranchBoxOption(((ControlScrollableContent<ControlList<IClassification>>) this).getContent(), value, y);
|
||||
return new ControlBranchBoxOption(this.getContent(), value, y);
|
||||
}
|
||||
|
||||
public ControlBranchBox(final IWidget parent, final float x, final float y, final float width, final float height) {
|
||||
|
||||
@@ -18,7 +18,7 @@ class ControlMutationBox extends ControlListBox<IMutation> {
|
||||
|
||||
@Override
|
||||
public IWidget createOption(final IMutation value, final int y) {
|
||||
return new ControlMutationItem(((ControlScrollableContent<ControlList<IMutation>>) this).getContent(), value, this.species, y);
|
||||
return new ControlMutationItem(this.getContent(), value, this.species, y);
|
||||
}
|
||||
|
||||
public ControlMutationBox(final IWidget parent, final int x, final int y, final int width, final int height, final Type type) {
|
||||
|
||||
@@ -19,7 +19,7 @@ public class ControlSpeciesBox extends ControlListBox<IAlleleSpecies> {
|
||||
|
||||
@Override
|
||||
public IWidget createOption(final IAlleleSpecies value, final int y) {
|
||||
return new ControlSpeciexBoxOption(((ControlScrollableContent<ControlList<IAlleleSpecies>>) this).getContent(), value, y);
|
||||
return new ControlSpeciexBoxOption(this.getContent(), value, y);
|
||||
}
|
||||
|
||||
public ControlSpeciesBox(final IWidget parent, final float x, final float y, final float width, final float height) {
|
||||
|
||||
@@ -8,6 +8,7 @@ import forestry.api.genetics.IClassification;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class PageBranchOverview extends PageBranch {
|
||||
private ControlText pageBranchOverview_branchName;
|
||||
@@ -33,7 +34,7 @@ public class PageBranchOverview extends PageBranch {
|
||||
}
|
||||
this.pageBranchOverview_branchDescription.clear();
|
||||
String desc = branch.getDescription();
|
||||
if (desc == null || desc == "") {
|
||||
if (desc == null || Objects.equals(desc, "")) {
|
||||
desc = "No Description Provided.";
|
||||
}
|
||||
String line = "";
|
||||
|
||||
@@ -9,6 +9,8 @@ import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class PageSpeciesOverview extends PageSpecies {
|
||||
private ControlText controlName;
|
||||
private ControlText controlScientific;
|
||||
@@ -44,7 +46,7 @@ public class PageSpeciesOverview extends PageSpecies {
|
||||
final String desc = species.getDescription();
|
||||
String descBody = "§o";
|
||||
String descSig = "";
|
||||
if (desc == null || desc == "") {
|
||||
if (desc == null || Objects.equals(desc, "")) {
|
||||
descBody += "No Description Provided.";
|
||||
} else {
|
||||
final String[] descStrings = desc.split("\\|");
|
||||
|
||||
@@ -32,6 +32,7 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public abstract class WindowAbstractDatabase extends Window {
|
||||
private float selectionBoxWidth;
|
||||
@@ -120,7 +121,7 @@ public abstract class WindowAbstractDatabase extends Window {
|
||||
widgets.listBox.setValidator(new IValidator<IWidget>() {
|
||||
@Override
|
||||
public boolean isValid(final IWidget object) {
|
||||
return event.getValue() == "" || ((ControlTextOption) object).getText().toLowerCase().contains(event.getValue().toLowerCase());
|
||||
return Objects.equals(event.getValue(), "") || ((ControlTextOption) object).getText().toLowerCase().contains(event.getValue().toLowerCase());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user