Minor cleanup and fixes

This commit is contained in:
mezz committed 2017-04-19 01:57:02 -07:00
1 parent 3bb678258f
commit 14c107ab71
30 files changed
+87 -117

No files matched your search

@@ -124,7 +124,7 @@ public class BlockStainedGlass extends Block implements IBlockMetadata, IColored
@Override
public boolean eventReceived(IBlockState state, World worldIn, BlockPos pos, int id, int param) {
TileEntity tileentity = worldIn.getTileEntity(pos);
return tileentity == null ? false : tileentity.receiveClientEvent(id, param);
return tileentity != null && tileentity.receiveClientEvent(id, param);
}
@Override
@@ -38,14 +38,11 @@ public class Tooltip {
}
public String getLine(final int index) {
final String string = this.getList().get(index);
return string;
return this.getList().get(index);
}
public void add(final List<String> list) {
for (final String obj : list) {
this.tooltip.add(obj);
}
this.tooltip.addAll(list);
}
public List<String> getList() {
@@ -39,16 +39,16 @@ public class PageBranchOverview extends PageBranch {
if (desc == null || Objects.equals(desc, "")) {
desc = Binnie.LANGUAGE.localise("binniecore.gui.database.no.description");
}
String line = "";
StringBuilder line = new StringBuilder();
final List<String> descLines = new ArrayList<>();
for (final String str : desc.split(" ")) {
if (RenderUtil.getTextWidth(line + " " + str) > 134) {
descLines.add(TextFormatting.ITALIC + line + TextFormatting.RESET);
line = "";
descLines.add(TextFormatting.ITALIC + line.toString() + TextFormatting.RESET);
line = new StringBuilder();
}
line = line + " " + str;
line.append(" ").append(str);
}
descLines.add(line);
descLines.add(line.toString());
int i = 0;
for (final String dLine : descLines) {
this.pageBranchOverview_branchDescription.add(new ControlTextCentered(this, 84 + 12 * i++, dLine));
@@ -49,21 +49,21 @@ public class PageSpeciesOverview extends PageSpecies {
this.controlAuthority.setValue(Binnie.LANGUAGE.localise("binniecore.gui.database.discovered") + ": " + TextFormatting.BOLD + species.getAuthority());
this.controlComplexity.setValue(Binnie.LANGUAGE.localise("binniecore.gui.database.overview.complexity") + ": " + species.getComplexity());
final String desc = species.getDescription();
String descBody = TextFormatting.ITALIC.toString();
StringBuilder descBody = new StringBuilder(TextFormatting.ITALIC.toString());
String descSig = "";
if (desc == null || Objects.equals(desc, "")) {
descBody += Binnie.LANGUAGE.localise("binniecore.gui.database.no.description");
descBody.append(Binnie.LANGUAGE.localise("binniecore.gui.database.no.description"));
} else {
final String[] descStrings = desc.split("\\|");
descBody += descStrings[0];
descBody.append(descStrings[0]);
for (int i = 1; i < descStrings.length - 1; ++i) {
descBody = descBody + " " + descStrings[i];
descBody.append(" ").append(descStrings[i]);
}
if (descStrings.length > 1) {
descSig += descStrings[descStrings.length - 1];
}
}
this.controlDescription.setValue(descBody + TextFormatting.RESET);
this.controlDescription.setValue(descBody.toString() + TextFormatting.RESET);
this.controlSignature.setValue(descSig);
final int descHeight = CraftGUI.render.textHeight(this.controlDescription.getValue(), this.controlDescription.getSize().x());
this.controlSignature.setPosition(new Point(this.controlSignature.pos().x(), this.controlDescription.getPosition().y() + descHeight + 10));
@@ -259,9 +259,8 @@ public class ContainerCraftGUI extends Container {
}
if (shouldSend) {
//TODO INVENTORY
this.crafters.stream().filter(Objects::nonNull).forEach(entityPlayer -> {
BinnieCore.getBinnieProxy().sendToPlayer(new MessageContainerUpdate(nbt.getValue()), entityPlayer);
});
this.crafters.stream().filter(Objects::nonNull).forEach(entityPlayer ->
BinnieCore.getBinnieProxy().sendToPlayer(new MessageContainerUpdate(nbt.getValue()), entityPlayer));
sentThisTime.put(nbt.getKey(), nbt.getValue());
}
}
@@ -108,9 +108,7 @@ public class TreeBreedingSystem extends BreedingSystem {
// {
// this.discoveredWoods.add(wood);
// }
for (final ItemStack fruit : genome.getFruitProvider().getProducts().keySet()) {
this.discoveredFruits.add(fruit);
}
this.discoveredFruits.addAll(genome.getFruitProvider().getProducts().keySet());
for (ItemStack wood2 : this.discoveredWoods) {
}
}
@@ -134,9 +132,7 @@ public class TreeBreedingSystem extends BreedingSystem {
// {
// this.allWoods.add(wood);
// }
for (final ItemStack fruit : genome.getFruitProvider().getProducts().keySet()) {
this.allFruits.add(fruit);
}
this.allFruits.addAll(genome.getFruitProvider().getProducts().keySet());
}
}
@@ -110,7 +110,7 @@ public class MachineUtil {
@Nullable
public FluidStack getFluid(final int tankInput) {
return (this.getTank(tankInput).getFluid() == null) ? null : this.getTank(tankInput).getFluid();
return this.getTank(tankInput).getFluid();
}
public ItemStack[] getStacks(final int[] slots) {
@@ -72,7 +72,7 @@ public class ComponentChargedSlots extends MachineComponent implements INetwork.
@Override
public float getCharge(final int slot) {
return this.charges.containsKey(slot) ? this.charges.get(slot) : 0.0f;
return this.charges.getOrDefault(slot, 0.0f);
}
@Override
@@ -22,7 +22,7 @@ class SidedAccess {
}
public AccessDirection getAccess(final EnumFacing side) {
return this.accesses.containsKey(side) ? this.accesses.get(side) : this.base;
return this.accesses.getOrDefault(side, this.base);
}
public boolean canInsert(final EnumFacing side) {
@@ -56,10 +56,10 @@ abstract class PropertyBase<ValueType, AnnotationType extends Annotation> {
}
protected String getComment() {
String comment = "";
StringBuilder comment = new StringBuilder();
for (final String com : this.comments) {
comment = comment + com + " ";
comment.append(com).append(" ");
}
return comment;
return comment.toString();
}
}
@@ -40,7 +40,7 @@ public class DoublePassBakedModel implements IBakedModel {
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) {
List<BakedQuad> quads = mainModel.getQuads(state, side, rand);
List<BakedQuad> recolored = new LinkedList<>();
quads.stream().forEach(quad -> {
quads.forEach(quad -> {
if (quad.hasTintIndex()) {
if (quad.getTintIndex() == 0)
recolored.add(recolorQuad(quad, primaryColor));
@@ -16,9 +16,9 @@ public interface IProxyCore extends IInitializable {
<B extends Block> void registerBlock(B block, ItemBlock itemBlock);
public void registerModels();
void registerModels();
public void registerItemAndBlockColors();
void registerItemAndBlockColors();
}
@@ -101,7 +101,7 @@ public enum ExtraBeeItems implements IItemMiscProvider {
Item woodGear = null;
try {
woodGear = (Item) Class.forName("buildcraft.BuildCraftCore").getField("woodenGearItem").get(null);
} catch (Exception ex) {
} catch (Exception ignored) {
}
ItemStack gear = new ItemStack(Blocks.PLANKS, 1);
if (woodGear != null) {
@@ -522,21 +522,21 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
}
public static class Birthday {
int day;
int month;
String name;
private final int month;
private final int date;
private final String name;
public boolean isToday() {
return Calendar.getInstance().get(5) == this.month && Calendar.getInstance().get(2) == this.day;
return Calendar.getInstance().get(Calendar.DATE) == this.date && Calendar.getInstance().get(Calendar.MONTH) == this.month;
}
public String getName() {
return this.name;
}
private Birthday(final int day, final int month, final String name) {
this.day = day;
this.month = month + 1;
private Birthday(final int month, final int date, final String name) {
this.month = month;
this.date = date + 1;
this.name = name;
}
}
@@ -58,11 +58,11 @@ public class ControlPunnett extends Control {
alleles.add(allele2);
}
}
String text = "";
StringBuilder text = new StringBuilder();
for (final IAllele allele3 : alleles) {
text = text + allele3.getName() + ": " + 25.0f / alleles.size() + "%\n";
text.append(allele3.getName()).append(": ").append(25.0f / alleles.size()).append("%\n");
}
new ControlText(this, new Area(x * ControlPunnett.boxWidth, ControlPunnett.boxHeight * y, ControlPunnett.boxWidth, ControlPunnett.boxHeight), text, TextJustification.TopCenter).setColour(11184810);
new ControlText(this, new Area(x * ControlPunnett.boxWidth, ControlPunnett.boxHeight * y, ControlPunnett.boxWidth, ControlPunnett.boxHeight), text.toString(), TextJustification.TopCenter).setColour(11184810);
++y;
}
++x;
@@ -160,9 +160,9 @@ public abstract class BlockETDecorativeLeaves extends Block implements IItemMode
*/
@Override
public int getMetaFromState(IBlockState state) {
/**
* Gets the metadata of the item this Block can drop. This method is called when the block gets destroyed. It returns
* the metadata of the dropped item based on the old metadata of the block.
/*
Gets the metadata of the item this Block can drop. This method is called when the block gets destroyed. It returns
the metadata of the dropped item based on the old metadata of the block.
*/
return damageDropped(state);
}
@@ -20,7 +20,7 @@ public class MultiFenceRecipeSize implements IRecipe {
@Override
public boolean matches(final InventoryCrafting inv, final World world) {
String recipePattern = "";
StringBuilder recipePattern = new StringBuilder();
List<IPlankType> types = new ArrayList<>();
for (int i = 0; i < inv.getSizeInventory(); ++i) {
ItemStack stack = inv.getStackInSlot(i);
@@ -35,7 +35,7 @@ public class MultiFenceRecipeSize implements IRecipe {
return false;
}
if (isEmpty) {
recipePattern += " ";
recipePattern.append(" ");
} else {
if (!types.contains(type)) {
types.add(type);
@@ -43,14 +43,14 @@ public class MultiFenceRecipeSize implements IRecipe {
return false;
}
}
recipePattern += types.indexOf(type);
recipePattern.append(types.indexOf(type));
}
}
if (types.isEmpty()) {
return false;
}
for(MultiFenceRecipePattern pattern : MultiFenceRecipePattern.VALUES){
if(pattern.matches(recipePattern)){
if(pattern.matches(recipePattern.toString())){
cached = pattern.createFence(types.get(0), types.get(pattern.getTypeCount() - 1));
return true;
}
@@ -18,7 +18,6 @@ import forestry.arboriculture.IWoodTyped;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
@@ -204,7 +203,7 @@ public class BlockShrubLog extends Block implements IWoodTyped, IStateMapperRegi
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
Random rand = world instanceof World ? ((World)world).rand : RANDOM;
List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
List<ItemStack> ret = new java.util.ArrayList<>();
float chance = 0.75F;
int amount = 2;
while(chance >= rand.nextFloat()){
@@ -272,7 +271,7 @@ public class BlockShrubLog extends Block implements IWoodTyped, IStateMapperRegi
@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, new IProperty[] { NORTH, EAST, WEST, SOUTH, FIREPROOF });
return new BlockStateContainer(this, NORTH, EAST, WEST, SOUTH, FIREPROOF);
}
@Override
@@ -46,13 +46,9 @@ public class ModuleCore implements IInitializable {
final Queue<IDesignMaterial> plankQueue = new LinkedList<>();
Collections.addAll(plankQueue, PlankType.ExtraTreePlanks.values());
final Queue<AlleleETFruit> fruitQueue = new LinkedList<>();
for (final AlleleETFruit wood3 : AlleleETFruit.values()) {
fruitQueue.add(wood3);
}
fruitQueue.addAll(AlleleETFruit.values());
final Queue<IDesign> designQueue = new LinkedList<>();
for (final IDesign wood4 : CarpentryManager.carpentryInterface.getSortedDesigns()) {
designQueue.add(wood4);
}
designQueue.addAll(CarpentryManager.carpentryInterface.getSortedDesigns());
fruitQueue.remove(AlleleETFruit.Apple);
outputSpecies.println("<table style=\"width: 100%;\">");
while (!speciesQueue.isEmpty()) {
@@ -370,10 +370,9 @@ public class AlleleETFruit extends AlleleCategorized implements IAlleleFruit, IF
@Override
public boolean trySpawnFruitBlock(ITreeGenome genome, World world, Random rand, BlockPos pos) {
if (this.pod != null && world.rand.nextFloat() <= genome.getSappiness()) {
return TreeManager.treeRoot.setFruitBlock(world, genome, this, genome.getSappiness(), pos);
}
return false;
return this.pod != null &&
world.rand.nextFloat() <= genome.getSappiness() &&
TreeManager.treeRoot.setFruitBlock(world, genome, this, genome.getSappiness(), pos);
}
@Override
@@ -20,7 +20,7 @@ public enum FruitSprite {
public static final FruitSprite[] VALUES = values();
private final ResourceLocation location;
private FruitSprite() {
FruitSprite() {
location = new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, "blocks/fruit/" + name().toLowerCase(Locale.ENGLISH));
}
@@ -142,7 +142,7 @@ public class ModuleItems implements IInitializable {
try {
final Item minium = (Item) Class.forName("com.pahimar.ee3.lib.ItemIds").getField("minium_shard").get(null);
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(Food.PAPAYIMAR.get(1), minium, "cropPapaya"));
} catch (Exception ex) {
} catch (Exception ignored) {
}
RecipeManagers.carpenterManager.addRecipe(100, Binnie.LIQUID.getFluidStack("water", 2000), ItemStack.EMPTY, new ItemStack(items.itemDictionary), "X#X", "YEY", "RDR", '#', Blocks.GLASS_PANE, 'X', Items.GOLD_INGOT, 'Y', "ingotCopper", 'R', Items.REDSTONE, 'D', Items.DIAMOND, 'E', Items.EMERALD);
RecipeManagers.carpenterManager.addRecipe(100, Binnie.LIQUID.getFluidStack("water", 2000), ItemStack.EMPTY, new ItemStack(items.itemDictionaryLepi), "X#X", "YEY", "RDR", '#', Blocks.GLASS_PANE, 'X', Items.GOLD_INGOT, 'Y', "ingotBronze", 'R', Items.REDSTONE, 'D', Items.DIAMOND, 'E', Items.EMERALD);
@@ -35,9 +35,4 @@ public class ControlTankSlot extends ControlSlotFluid {
this.itemDisplay.setCroppedZone(this.itemDisplay, new Area(0, 16 - height, 16, 16));
super.onUpdateClient();
}
@Override
public void onRenderBackground(int guiWidth, int guiHeight) {
super.onRenderBackground(guiWidth, guiHeight);
}
}
@@ -55,15 +55,15 @@ public class PagePlanksOverview extends PageAbstract<ItemStack> {
if (type != null) {
desc = type.getDescription();
}
String descBody = "§o";
StringBuilder descBody = new StringBuilder("§o");
String descSig = "";
if (desc == null || desc.length() == 0) {
descBody += BinnieCore.getBinnieProxy().localise("gui.database.nodescription");
descBody.append(BinnieCore.getBinnieProxy().localise("gui.database.nodescription"));
} else {
final String[] descStrings = desc.split("\\|");
descBody += descStrings[0];
descBody.append(descStrings[0]);
for (int i = 1; i < descStrings.length - 1; ++i) {
descBody = descBody + " " + descStrings[i];
descBody.append(" ").append(descStrings[i]);
}
if (descStrings.length > 1) {
descSig += descStrings[descStrings.length - 1];
@@ -102,9 +102,7 @@ public class PageSpeciesTreeGenome extends PageSpecies {
new ControlText(contents, new Area(w2, y, w3, th), genome.getFertility() + "x", TextJustification.MIDDLE_LEFTt);
y += th;
List<ItemStack> fruits = new ArrayList<>();
for (ItemStack stack : products.keySet()) {
fruits.add(stack);
}
fruits.addAll(products.keySet());
if (!fruits.isEmpty()) {
new ControlText(contents, new Area(0, y, w2, th2), syst.getChromosomeShortName(EnumTreeChromosome.FRUITS) + " : ", TextJustification.MiddleRight);
for (ItemStack fruitw : fruits) {
@@ -19,6 +19,7 @@ import binnie.core.craftgui.geometry.Area;
import binnie.core.craftgui.minecraft.Window;
import binnie.core.genetics.TreeBreedingSystem;
import binnie.extratrees.ExtraTrees;
import binnie.extratrees.api.IDesignMaterial;
import binnie.extratrees.block.WoodManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -54,37 +55,43 @@ public class WindowArboristDatabase extends WindowAbstractDatabase {
this.createMode(TreeMode.FRUIT, new ModeWidgets(TreeMode.FRUIT, this) {
@Override
public void createListBox(final Area area) {
(this.listBox = new ControlListBox<ItemStack>(this.modePage, area.xPos(), area.yPos(), area.width(), area.height(), 12) {
ControlListBox<ItemStack> controlListBox = new ControlListBox<ItemStack>(this.modePage, area.xPos(), area.yPos(), area.width(), area.height(), 12) {
@Override
@SideOnly(Side.CLIENT)
public IWidget createOption(final ItemStack value, final int y) {
return new ControlItemStackOption(this.getContent(), value, y);
}
}).setOptions(((TreeBreedingSystem) WindowArboristDatabase.this.getBreedingSystem()).allFruits);
};
controlListBox.setOptions(((TreeBreedingSystem) WindowArboristDatabase.this.getBreedingSystem()).allFruits);
this.listBox = controlListBox;
}
});
this.createMode(TreeMode.WOOD, new ModeWidgets(TreeMode.WOOD, this) {
@Override
public void createListBox(final Area area) {
(this.listBox = new ControlListBox<ItemStack>(this.modePage, area.xPos(), area.yPos(), area.width(), area.height(), 12) {
ControlListBox<ItemStack> controlListBox = new ControlListBox<ItemStack>(this.modePage, area.xPos(), area.yPos(), area.width(), area.height(), 12) {
@Override
@SideOnly(Side.CLIENT)
public IWidget createOption(final ItemStack value, final int y) {
return new ControlItemStackOption(this.getContent(), value, y);
}
}).setOptions(((TreeBreedingSystem) WindowArboristDatabase.this.getBreedingSystem()).allWoods);
};
controlListBox.setOptions(((TreeBreedingSystem) WindowArboristDatabase.this.getBreedingSystem()).allWoods);
this.listBox = controlListBox;
}
});
this.createMode(TreeMode.PLANKS, new ModeWidgets(TreeMode.PLANKS, this) {
@Override
public void createListBox(final Area area) {
(this.listBox = new ControlListBox<ItemStack>(this.modePage, area.xPos(), area.yPos(), area.width(), area.height(), 12) {
ControlListBox<ItemStack> controlListBox = new ControlListBox<ItemStack>(this.modePage, area.xPos(), area.yPos(), area.width(), area.height(), 12) {
@Override
@SideOnly(Side.CLIENT)
public IWidget createOption(final ItemStack value, final int y) {
return new ControlItemStackOption(this.getContent(), value, y);
}
}).setOptions(WoodManager.getAllPlankTypes().stream().<ItemStack>map(type -> type.getStack()).collect(Collectors.toList()));
};
controlListBox.setOptions(WoodManager.getAllPlankTypes().stream().map(IDesignMaterial::getStack).collect(Collectors.toList()));
this.listBox = controlListBox;
}
});
new PageFruit(this.getInfoPages(TreeMode.FRUIT), new DatabaseTab(ExtraTrees.instance, "fruit.natural", 0), true);
@@ -26,15 +26,15 @@ public class AnalystPageDescription extends ControlAnalystPage {
final String branchBinomial = species.getBranch().getScientific();
final String branchName = species.getBranch().getName();
final String desc = species.getDescription();
String descBody = TextFormatting.ITALIC.toString();
StringBuilder descBody = new StringBuilder(TextFormatting.ITALIC.toString());
String descSig = "";
if (Objects.equals(desc, "") || desc.contains("for.description")) {
descBody += "";
descBody.append("");
} else {
final String[] descStrings = desc.split("\\|");
descBody += descStrings[0];
descBody.append(descStrings[0]);
for (int i = 1; i < descStrings.length - 1; ++i) {
descBody = descBody + " " + descStrings[i];
descBody.append(" ").append(descStrings[i]);
}
if (descStrings.length > 1) {
descSig += descStrings[descStrings.length - 1];
@@ -39,12 +39,8 @@ public class AnalystPageFruit extends AnalystPageProduce {
final Collection<ItemStack> products = new UniqueItemStackSet();
final Collection<ItemStack> specialties = new UniqueItemStackSet();
final Collection<ItemStack> wiid = new UniqueItemStackSet();
for (final ItemStack stack : ind.getProducts().keySet()) {
products.add(stack);
}
for (final ItemStack stack : ind.getSpecialties().keySet()) {
specialties.add(stack);
}
products.addAll(ind.getProducts().keySet());
specialties.addAll(ind.getSpecialties().keySet());
try {
if (ind.getGenome().getFruitProvider() instanceof FruitProviderPod) {
final FruitProviderPod pod = (FruitProviderPod) ind.getGenome().getFruitProvider();
@@ -80,12 +76,8 @@ public class AnalystPageFruit extends AnalystPageProduce {
y += 26;
}
final Collection<ItemStack> allProducts = new UniqueItemStackSet();
for (final ItemStack stack3 : products) {
allProducts.add(stack3);
}
for (final ItemStack stack3 : specialties) {
allProducts.add(stack3);
}
allProducts.addAll(products);
allProducts.addAll(specialties);
final Collection<ItemStack> refinedProducts = new UniqueItemStackSet();
refinedProducts.addAll(this.getAllProductsAndFluids(allProducts));
if (refinedProducts.size() > 0) {
@@ -103,12 +95,8 @@ public class AnalystPageFruit extends AnalystPageProduce {
final Collection<ItemStack> stacks = new UniqueItemStackSet();
for (final IAllele a : fruitAlleles) {
if (((IAlleleFruit) a).getProvider().getFamily() == fam) {
for (final ItemStack p : ((IAlleleFruit) a).getProvider().getProducts().keySet()) {
stacks.add(p);
}
for (final ItemStack p : ((IAlleleFruit) a).getProvider().getSpecialty().keySet()) {
stacks.add(p);
}
stacks.addAll(((IAlleleFruit) a).getProvider().getProducts().keySet());
stacks.addAll(((IAlleleFruit) a).getProvider().getSpecialty().keySet());
try {
if (a.getUID().contains("fruitCocoa")) {
stacks.add(new ItemStack(Items.DYE, 1, 3));
@@ -41,9 +41,7 @@ public class AnalystPageWood extends AnalystPageProduce {
if (!stackWood.isEmpty()) {
products.add(stackWood);
}
for (final ItemStack stack : ind.getGenome().getFruitProvider().getProducts().keySet()) {
products.add(stack);
}
products.addAll(ind.getGenome().getFruitProvider().getProducts().keySet());
if (products.size() > 0) {
new ControlTextCentered(this, y, Genetics.proxy.localise("gui.analyst.wood.logs")).setColour(this.getColour());
y += 10;
@@ -57,9 +55,7 @@ public class AnalystPageWood extends AnalystPageProduce {
y += 26;
}
final Collection<ItemStack> allProducts = new UniqueItemStackSet();
for (final ItemStack stack2 : products) {
allProducts.add(stack2);
}
allProducts.addAll(products);
final Collection<ItemStack> refinedProducts = new UniqueItemStackSet();
refinedProducts.addAll(this.getAllProductsAndFluids(allProducts));
if (refinedProducts.size() > 0) {
@@ -36,18 +36,18 @@ public class ControlSequencerProgress extends ControlProgressBase {
this.textControl.setValue("");
} else {
Random rand = new Random(stackTarget.getDisplayName().length());
String text = "";
StringBuilder text = new StringBuilder();
for (int i = 0; i < 65; ++i) {
int k = rand.nextInt(4);
String code = CODES[k];
if (rand.nextFloat() < this.progress) {
String color = "�" + COLORS[k];
text = text + "�r" + color + "�l" + code;
text.append("�r").append(color).append("�l").append(code);
} else {
text = text + "�r�7�k�l" + code;
text.append("�r�7�k�l").append(code);
}
}
this.textControl.setValue(text);
this.textControl.setValue(text.toString());
}
}
}