diff options
Diffstat (limited to 'src/Java/gtPlusPlus/core')
6 files changed, 298 insertions, 21 deletions
diff --git a/src/Java/gtPlusPlus/core/block/base/BlockBaseOre.java b/src/Java/gtPlusPlus/core/block/base/BlockBaseOre.java index bc0c12fd2f..cb0961eb66 100644 --- a/src/Java/gtPlusPlus/core/block/base/BlockBaseOre.java +++ b/src/Java/gtPlusPlus/core/block/base/BlockBaseOre.java @@ -1,17 +1,22 @@ package gtPlusPlus.core.block.base; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; -import gtPlusPlus.core.lib.CORE; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.ITexturedTileEntity; +import gregtech.api.objects.GT_CopiedBlockTexture; +import gregtech.api.objects.GT_RenderedTexture; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.client.renderer.CustomOreBlockRenderer; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.math.MathUtils; -import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.block.Block; import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; -public class BlockBaseOre extends BlockBaseModular{ +public class BlockBaseOre extends BlockBaseModular implements ITexturedTileEntity { @SuppressWarnings("unused") private IIcon base; @@ -24,7 +29,7 @@ public class BlockBaseOre extends BlockBaseModular{ }*/ protected Material blockMaterial; - + protected int blockColour; protected BlockTypes thisBlock; protected String thisBlockMaterial; @@ -32,8 +37,9 @@ public class BlockBaseOre extends BlockBaseModular{ public BlockBaseOre(final Material material, final BlockTypes blockType, final int colour) { this(material.getUnlocalizedName(), material.getLocalizedName(), net.minecraft.block.material.Material.iron, blockType, colour, 3); + blockMaterial = material; } - + public BlockBaseOre(final String unlocalizedName, final String blockMaterial, final BlockTypes blockType, final int colour) { this(unlocalizedName, blockMaterial, net.minecraft.block.material.Material.iron, blockType, colour, 2); @@ -64,16 +70,16 @@ public class BlockBaseOre extends BlockBaseModular{ return true; }*/ - @Override + /*@Override @SideOnly(Side.CLIENT) public void registerBlockIcons(final IIconRegister iIcon) { this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + this.thisBlock.getTexture()); //this.base = iIcon.registerIcon(CORE.MODID + ":" + "blockStone"); //this.overlay = iIcon.registerIcon(CORE.MODID + ":" + "blockOre_Overlay"); - } + }*/ - @Override + /*@Override public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4){ if (this.blockColour == 0){ return MathUtils.generateSingularRandomHexValue(); @@ -87,13 +93,43 @@ public class BlockBaseOre extends BlockBaseModular{ return MathUtils.generateSingularRandomHexValue(); } return this.blockColour; - } + }*/ @Override public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) { return false; } + @Override + public int getRenderType() { + return CustomOreBlockRenderer.INSTANCE.mRenderID; + } + + @Override + public IIcon getIcon(IBlockAccess aIBlockAccess, int aX, int aY, int aZ, int aSide) { + return Blocks.stone.getIcon(0, 0); + } + + @Override + public IIcon getIcon(int aSide, int aMeta) { + return Blocks.stone.getIcon(0, 0); + } + + /** + * GT Texture Handler + */ + + @Override + public ITexture[] getTexture(Block block, byte side) { + if (this.blockMaterial != null){ + GT_RenderedTexture aIconSet = new GT_RenderedTexture(Materials.Iron.mIconSet.mTextures[OrePrefixes.ore.mTextureIndex], this.blockMaterial.getRGBA()); + if (aIconSet != null){ + //Logger.INFO("[Render] Good Overlay."); + return new ITexture[]{new GT_CopiedBlockTexture(Blocks.stone, 0, 0), aIconSet}; + } + } + return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.STONES[0], new short[]{240, 240, 240, 0})}; + } diff --git a/src/Java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java b/src/Java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java new file mode 100644 index 0000000000..0c94cfe993 --- /dev/null +++ b/src/Java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java @@ -0,0 +1,199 @@ +package gtPlusPlus.core.client.renderer; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.ITexturedTileEntity; +import gtPlusPlus.api.objects.Logger; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; + +public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler{ + + public static CustomOreBlockRenderer INSTANCE; + public final int mRenderID; + + public CustomOreBlockRenderer() { + this.mRenderID = RenderingRegistry.getNextAvailableRenderId(); + INSTANCE = this; + RenderingRegistry.registerBlockHandler(this); + Logger.INFO("Registered Custom Ore Block Renderer."); + } + + public static boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) { + Block tTileEntity = aBlock; + if ((tTileEntity instanceof ITexturedTileEntity)) { + return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, new ITexture[][]{((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 0), ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 1), ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 2), ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 3), ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 4), ((ITexturedTileEntity) tTileEntity).getTexture(aBlock, (byte) 5)}); + } + return false; + } + + public static boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer, ITexture[][] aTextures) { + aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + aRenderer.setRenderBoundsFromBlock(aBlock); + + renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[0], true); + renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[1], true); + renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[2], true); + renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[3], true); + renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[4], true); + renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[5], true); + return true; + } + + public static void renderNegativeYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { + if (aWorld != null) { + if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY - 1, aZ, 0))) { + return; + } + Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY - 1 : aY, aZ)); + } + if (aIcon != null) { + for (int i = 0; i < aIcon.length; i++) { + if (aIcon[i] != null) { + aIcon[i].renderYNeg(aRenderer, aBlock, aX, aY, aZ); + } + } + } + aRenderer.flipTexture = false; + } + + public static void renderPositiveYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { + if (aWorld != null) { + if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY + 1, aZ, 1))) { + return; + } + Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY + 1 : aY, aZ)); + } + if (aIcon != null) { + for (int i = 0; i < aIcon.length; i++) { + if (aIcon[i] != null) { + aIcon[i].renderYPos(aRenderer, aBlock, aX, aY, aZ); + } + } + } + aRenderer.flipTexture = false; + } + + public static void renderNegativeZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { + if (aWorld != null) { + if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ - 1, 2))) { + return; + } + Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ - 1 : aZ)); + } + aRenderer.flipTexture = (!aFullBlock); + if (aIcon != null) { + for (int i = 0; i < aIcon.length; i++) { + if (aIcon[i] != null) { + aIcon[i].renderZNeg(aRenderer, aBlock, aX, aY, aZ); + } + } + } + aRenderer.flipTexture = false; + } + + public static void renderPositiveZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { + if (aWorld != null) { + if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ + 1, 3))) { + return; + } + Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ + 1 : aZ)); + } + if (aIcon != null) { + for (int i = 0; i < aIcon.length; i++) { + if (aIcon[i] != null) { + aIcon[i].renderZPos(aRenderer, aBlock, aX, aY, aZ); + } + } + } + aRenderer.flipTexture = false; + } + + public static void renderNegativeXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { + if (aWorld != null) { + if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX - 1, aY, aZ, 4))) { + return; + } + Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX - 1 : aX, aY, aZ)); + } + if (aIcon != null) { + for (int i = 0; i < aIcon.length; i++) { + if (aIcon[i] != null) { + aIcon[i].renderXNeg(aRenderer, aBlock, aX, aY, aZ); + } + } + } + aRenderer.flipTexture = false; + } + + public static void renderPositiveXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ, ITexture[] aIcon, boolean aFullBlock) { + if (aWorld != null) { + if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX + 1, aY, aZ, 5))) { + return; + } + Tessellator.instance.setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX + 1 : aX, aY, aZ)); + } + aRenderer.flipTexture = (!aFullBlock); + if (aIcon != null) { + for (int i = 0; i < aIcon.length; i++) { + if (aIcon[i] != null) { + aIcon[i].renderXPos(aRenderer, aBlock, aX, aY, aZ); + } + } + } + aRenderer.flipTexture = false; + } + + public void renderInventoryBlock(Block aBlock, int aMeta, int aModelID, RenderBlocks aRenderer) { + aBlock.setBlockBoundsForItemRender(); + aRenderer.setRenderBoundsFromBlock(aBlock); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + Tessellator.instance.startDrawingQuads(); + Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F); + renderNegativeYFacing(null, aRenderer, aBlock, 0, 0, 0, ((ITexturedTileEntity) aBlock).getTexture(aBlock, (byte) 0), true); + Tessellator.instance.draw(); + Tessellator.instance.startDrawingQuads(); + Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F); + renderPositiveYFacing(null, aRenderer, aBlock, 0, 0, 0, ((ITexturedTileEntity) aBlock).getTexture(aBlock, (byte) 1), true); + Tessellator.instance.draw(); + Tessellator.instance.startDrawingQuads(); + Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F); + renderNegativeZFacing(null, aRenderer, aBlock, 0, 0, 0, ((ITexturedTileEntity) aBlock).getTexture(aBlock, (byte) 2), true); + Tessellator.instance.draw(); + Tessellator.instance.startDrawingQuads(); + Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F); + renderPositiveZFacing(null, aRenderer, aBlock, 0, 0, 0, ((ITexturedTileEntity) aBlock).getTexture(aBlock, (byte) 3), true); + Tessellator.instance.draw(); + Tessellator.instance.startDrawingQuads(); + Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F); + renderNegativeXFacing(null, aRenderer, aBlock, 0, 0, 0, ((ITexturedTileEntity) aBlock).getTexture(aBlock, (byte) 4), true); + Tessellator.instance.draw(); + Tessellator.instance.startDrawingQuads(); + Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F); + renderPositiveXFacing(null, aRenderer, aBlock, 0, 0, 0, ((ITexturedTileEntity) aBlock).getTexture(aBlock, (byte) 5), true); + Tessellator.instance.draw(); + aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + aRenderer.setRenderBoundsFromBlock(aBlock); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + public boolean renderWorldBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int aModelID, RenderBlocks aRenderer) { + return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer); + } + + public boolean shouldRender3DInInventory(int aModel) { + return true; + } + + public int getRenderId() { + return this.mRenderID; + } + +} diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index 796d48b967..751a371bdb 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -104,7 +104,10 @@ public class Material { try { this.unlocalizedName = Utils.sanitizeString(materialName); this.localizedName = materialName; + this.materialState = defaultState; + Logger.MATERIALS(this.getLocalizedName()+" is "+defaultState.name()+"."); + this.RGBA = rgba; this.vGenerateCells = generateCells; @@ -332,12 +335,24 @@ public class Material { return this.materialState; } - final public short[] getRGBA(){ + final public short[] getRGB(){ if (this.RGBA != null) { return this.RGBA; } return new short[] {255,0,0}; } + + final public short[] getRGBA(){ + if (this.RGBA != null) { + if (this.RGBA.length == 4){ + return this.RGBA; + } + else { + return new short[]{this.RGBA[0], this.RGBA[1], this.RGBA[2], 0}; + } + } + return new short[] {255,0,0, 0}; + } final public int getRgbAsHex(){ diff --git a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java index f20c3ef91a..924a8070a4 100644 --- a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java +++ b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java @@ -78,6 +78,12 @@ public class ClientProxy extends CommonProxy implements Runnable{ if (LoadedMods.PlayerAPI){ this.init_PlayerAPI_INIT(); } + + /** + * Custom Block Renderers + */ + new CustomOreBlockRenderer(); + super.init(e); } @@ -106,6 +112,10 @@ public class ClientProxy extends CommonProxy implements Runnable{ //MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.tutChest), new ItemRenderBloodSteelChest()); Logger.INFO("Registering Custom Renderer for the Fire Pit."); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFirepit.class, new FirepitRender()); + + //Special Renderers + //RenderingRegistry.registerBlockHandler((CustomOreBlockRenderer.mRenderID=RenderingRegistry.getNextAvailableRenderId()), new CustomOreBlockRenderer()); + } @Override diff --git a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java index 48279a91d9..cc9a679193 100644 --- a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java +++ b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java @@ -5,6 +5,7 @@ import java.util.List; import org.apache.commons.lang3.reflect.FieldUtils; import gregtech.api.enums.*; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.StringUtils; @@ -44,6 +45,7 @@ public class MaterialUtils { final long neutrons = material.getNeutrons(); final boolean blastFurnace = material.mBlastFurnaceRequired; final int durability = material.mDurability; + boolean mGenerateCell = false; MaterialState materialState; final String chemicalFormula = StringUtils.subscript(Utils.sanitizeString(material.mChemicalFormula)); final Element element = material.mElement; @@ -53,19 +55,34 @@ public class MaterialUtils { } //Determine default state - if (material.getMolten(1) != null){ + Logger.MATERIALS("[Debug] Setting State of GT generated material."); + if (material.getMolten(1) != null || material.getSolid(1) != null){ materialState = MaterialState.SOLID; + Logger.MATERIALS("[Debug] Molten or Solid was not null."); + if (material.getMolten(1) == null && material.getSolid(1) != null){ + Logger.MATERIALS("[Debug] Molten is Null, Solid is not. Enabling cell generation."); + mGenerateCell = true; + } + else if (material.getMolten(1) != null && material.getSolid(1) == null){ + Logger.MATERIALS("[Debug] Molten is not Null, Solid is null. Not enabling cell generation."); + //mGenerateCell = true; + } + Logger.MATERIALS("[Debug] State set as solid."); } else if (material.getFluid(1) != null){ + Logger.MATERIALS("[Debug] State set as liquid."); materialState = MaterialState.LIQUID; } else if (material.getGas(1) != null){ + Logger.MATERIALS("[Debug] State set as gas."); materialState = MaterialState.GAS; - } + }/* else if (material.getPlasma(1) != null){ + Logger.MATERIALS("[Debug] State set as plasma."); materialState = MaterialState.PLASMA; - } + }*/ else { + Logger.MATERIALS("[Debug] State set as solid."); materialState = MaterialState.SOLID; } @@ -77,7 +94,7 @@ public class MaterialUtils { if (hasValidRGBA(rgba) || (element == Element.H) || ((material == Materials.InfusedAir) || (material == Materials.InfusedFire) || (material == Materials.InfusedEarth) || (material == Materials.InfusedWater))){ //ModItems.itemBaseDecidust = UtilsItems.generateDecidust(material); //ModItems.itemBaseCentidust = UtilsItems.generateCentidust(material); - return new Material(name, materialState, durability, rgba, melting, boiling, protons, neutrons, blastFurnace, chemicalFormula, radioactivity, false); + return new Material(name, materialState, durability, rgba, melting, boiling, protons, neutrons, blastFurnace, chemicalFormula, radioactivity, mGenerateCell); } return null; diff --git a/src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_GT_Base.java b/src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_GT_Base.java index f04609dc6f..608bf91e58 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_GT_Base.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_GT_Base.java @@ -109,10 +109,10 @@ public class WorldGen_GT_Base implements IWorldGenerator{ //... } - private void generateDarkWorld(Random aRandom, int aX, int aZ, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider){ + private synchronized void generateDarkWorld(Random aRandom, int aX, int aZ, World aWorld, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider){ synchronized (listLock) { - WorldGen_GT_Base.mList.add(new WorldGenContainer(new XSTR(Math.abs(aRandom.nextInt()) +1), aX, aZ, ((aChunkGenerator instanceof ChunkProviderEnd)) || (aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8) == BiomeGenBase.sky) ? 1 : ((aChunkGenerator instanceof ChunkProviderHell)) || (aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8) == BiomeGenBase.hell) ? -1 : 0, aWorld, aChunkGenerator, aChunkProvider, aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName)); + WorldGen_GT_Base.mList.add(new WorldGenContainer(new CSPRNG(Math.abs(aRandom.nextInt()) +1), aX, aZ, ((aChunkGenerator instanceof ChunkProviderEnd)) || (aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8) == BiomeGenBase.sky) ? 1 : ((aChunkGenerator instanceof ChunkProviderHell)) || (aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8) == BiomeGenBase.hell) ? -1 : 0, aWorld, aChunkGenerator, aChunkProvider, aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName)); if (debugWorldGen) GT_Log.out.println( "ADD WorldSeed:"+aWorld.getSeed() + " DimId" + aWorld.provider.dimensionId + @@ -229,7 +229,7 @@ public class WorldGen_GT_Base implements IWorldGenerator{ ); // Search for a valid orevein for this dimension - if(validOreveins.size() > 0 && !validOreveins.containsKey(oreveinSeed) ) { + if(!validOreveins.containsKey(oreveinSeed) ) { if ( (oreveinPercentageRoll<oreveinPercentage) && (WorldGen_GT_Ore_Layer.sWeight > 0) && (WorldGen_GT_Ore_Layer.sList.size() > 0)) { int placementAttempts = 0; boolean oreveinFound = false; |