[ci skip] spotlessApply with the new settings

This commit is contained in:
Jason Mitchell committed 2023-01-28 19:14:12 -08:00
1 parent 07f445757b
commit 91bf137a94
809 files changed
+6761 -5793

No files matched your search

@@ -1,5 +1,16 @@
package binnie.genetics.craftgui;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import binnie.Binnie;
import binnie.core.AbstractMod;
import binnie.core.craftgui.Tooltip;
@@ -27,17 +38,9 @@ import binnie.genetics.genetics.GeneTracker;
import cpw.mods.fml.relauncher.Side;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.IChromosomeType;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
public class WindowGeneBank extends WindowMachine {
public boolean isNei;
protected ControlGeneScroll genes;
@@ -84,6 +87,7 @@ public class WindowGeneBank extends WindowMachine {
public void initialiseClient() {
setTitle(getTitle());
addEventHandler(new EventValueChanged.Handler() {
@Override
public void onEvent(EventValueChanged event) {
if (event.value instanceof BreedingSystem) {
@@ -101,57 +105,66 @@ public class WindowGeneBank extends WindowMachine {
int geneBoxWidth = 120;
new Panel(this, boxX + 24, 32.0f, geneBoxWidth, 120.0f, MinecraftGUI.PanelType.Black);
new Panel(this, boxX + 24 + geneBoxWidth, 32.0f, 14.0f, 120.0f, MinecraftGUI.PanelType.Gray);
ControlScrollableContent scroll =
new ControlScrollableContent(this, boxX + 24 + 2, 34.0f, geneBoxWidth + 10, 116.0f, 12.0f);
ControlScrollableContent scroll = new ControlScrollableContent(
this,
boxX + 24 + 2,
34.0f,
geneBoxWidth + 10,
116.0f,
12.0f);
ControlTextEdit edit = new ControlTextEdit(this, boxX + 27 + geneBoxWidth - 70, 18.0f, 80.0f, 12.0f);
addEventHandler(
new EventTextEdit.Handler() {
@Override
public void onEvent(EventTextEdit event) {
genes.setFilter(event.getValue());
}
}.setOrigin(EventHandler.Origin.Self, edit));
addEventHandler(new EventTextEdit.Handler() {
@Override
public void onEvent(EventTextEdit event) {
genes.setFilter(event.getValue());
}
}.setOrigin(EventHandler.Origin.Self, edit));
scroll.setScrollableContent(genes = new ControlGeneScroll(scroll, 1.0f, 1.0f, geneBoxWidth, 116.0f));
genes.setGenes(Binnie.Genetics.beeBreedingSystem);
ControlTabBar<BreedingSystem> tabBar =
new ControlTabBar<BreedingSystem>(this, boxX, 32.0f, 24.0f, 120.0f, Position.LEFT) {
ControlTabBar<BreedingSystem> tabBar = new ControlTabBar<BreedingSystem>(
this,
boxX,
32.0f,
24.0f,
120.0f,
Position.LEFT) {
@Override
public ControlTab<BreedingSystem> createTab(float x, float y, float w, float h, BreedingSystem value) {
return new ControlTabIcon<BreedingSystem>(this, x, y, w, h, value) {
@Override
public ControlTab<BreedingSystem> createTab(
float x, float y, float w, float h, BreedingSystem value) {
return new ControlTabIcon<BreedingSystem>(this, x, y, w, h, value) {
@Override
public void getTooltip(Tooltip tooltip) {
tooltip.add(getValue().toString());
int totalGenes = 0;
int seqGenes = 0;
GeneTracker tracker = GeneTracker.getTracker(getWorld(), getUsername());
Map<IChromosomeType, List<IAllele>> genes = Binnie.Genetics.getChromosomeMap(
getValue().getSpeciesRoot());
for (Map.Entry<IChromosomeType, List<IAllele>> entry : genes.entrySet()) {
totalGenes += entry.getValue().size();
for (IAllele allele : entry.getValue()) {
Gene gene = new Gene(
allele,
entry.getKey(),
getValue().getSpeciesRoot());
if (tracker.isSequenced(gene)) {
seqGenes++;
}
}
public void getTooltip(Tooltip tooltip) {
tooltip.add(getValue().toString());
int totalGenes = 0;
int seqGenes = 0;
GeneTracker tracker = GeneTracker.getTracker(getWorld(), getUsername());
Map<IChromosomeType, List<IAllele>> genes = Binnie.Genetics
.getChromosomeMap(getValue().getSpeciesRoot());
for (Map.Entry<IChromosomeType, List<IAllele>> entry : genes.entrySet()) {
totalGenes += entry.getValue().size();
for (IAllele allele : entry.getValue()) {
Gene gene = new Gene(allele, entry.getKey(), getValue().getSpeciesRoot());
if (tracker.isSequenced(gene)) {
seqGenes++;
}
tooltip.add(I18N.localise(
"genetics.gui.geneBank.sequencedGenes.short", seqGenes, totalGenes));
}
};
}
tooltip.add(I18N.localise("genetics.gui.geneBank.sequencedGenes.short", seqGenes, totalGenes));
}
};
}
};
tabBar.setValues(Binnie.Genetics.getActiveSystems());
tabBar.setValue(Binnie.Genetics.beeBreedingSystem);
boxX -= 8;
ControlTabBar<String> infoTabs = new ControlTabBar<>(this, boxX + 8, 160.0f, 16.0f, 50.0f, Position.LEFT);
infoTabs.setValues(Arrays.asList(
I18N.localise("genetics.gui.geneBank.stats"), I18N.localise("genetics.gui.geneBank.ranking")));
infoTabs.setValues(
Arrays.asList(
I18N.localise("genetics.gui.geneBank.stats"),
I18N.localise("genetics.gui.geneBank.ranking")));
infoTabs.setValue(I18N.localise("genetics.gui.geneBank.info"));
Panel panelProject = new Panel(this, boxX + 24, 160.0f, geneBoxWidth + 20, 50.0f, MinecraftGUI.PanelType.Black);
int totalGenes = 0;
@@ -178,8 +191,7 @@ public class WindowGeneBank extends WindowMachine {
new ControlText(
panelProject,
new IPoint(4.0f, 18.0f),
EnumChatFormatting.ITALIC.toString()
+ EnumChatFormatting.YELLOW
EnumChatFormatting.ITALIC.toString() + EnumChatFormatting.YELLOW
+ I18N.localise("genetics.gui.geneBank.sequencedGenes", seqGenes, totalGenes));
}