mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-26 15:03:14 +00:00
Autoformat: spaces to tabs, remove unused imports
This commit is contained in:
1 parent
a6d1a9f1a4
commit
dac7c0ddef
93 files changed
+3159
-3058
No files matched your search
@@ -1,28 +1,28 @@
|
||||
package magicbees.world.feature;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class FeatureOreVein
|
||||
{
|
||||
private Block veinBlock;
|
||||
private int veinBlockMeta;
|
||||
private Block replacesBlock;
|
||||
|
||||
|
||||
public FeatureOreVein(Block block, Block replacesBlock)
|
||||
{
|
||||
this(block, 0, replacesBlock);
|
||||
}
|
||||
|
||||
|
||||
public FeatureOreVein(Block block, int meta, Block replacesBlock)
|
||||
{
|
||||
this.veinBlock = block;
|
||||
this.veinBlockMeta = meta;
|
||||
this.replacesBlock = replacesBlock;
|
||||
}
|
||||
|
||||
|
||||
public void generateVein(World world, Random random, int startX, int startY, int startZ, int maxSpawnCount)
|
||||
{
|
||||
int currentX = startX;
|
||||
@@ -30,11 +30,11 @@ public class FeatureOreVein
|
||||
int currentZ = startZ;
|
||||
int spawnAttempts = 0;
|
||||
int spawnCount = 0;
|
||||
|
||||
|
||||
while (spawnCount < maxSpawnCount && spawnAttempts < maxSpawnCount * 2)
|
||||
{
|
||||
++spawnAttempts;
|
||||
|
||||
|
||||
if (!world.isAirBlock(currentX, currentY, currentZ) && canBlockReplaceAt(world, currentX, currentY, currentZ, replacesBlock))
|
||||
{
|
||||
world.setBlock(currentX, currentY, currentZ, this.veinBlock, this.veinBlockMeta, 2);
|
||||
@@ -43,28 +43,28 @@ public class FeatureOreVein
|
||||
|
||||
switch (random.nextInt(6))
|
||||
{
|
||||
case 0:
|
||||
++currentY;
|
||||
break;
|
||||
case 1:
|
||||
--currentY;
|
||||
break;
|
||||
case 2:
|
||||
++currentZ;
|
||||
break;
|
||||
case 3:
|
||||
--currentZ;
|
||||
break;
|
||||
case 4:
|
||||
++currentX;
|
||||
break;
|
||||
case 5:
|
||||
--currentX;
|
||||
break;
|
||||
case 0:
|
||||
++currentY;
|
||||
break;
|
||||
case 1:
|
||||
--currentY;
|
||||
break;
|
||||
case 2:
|
||||
++currentZ;
|
||||
break;
|
||||
case 3:
|
||||
--currentZ;
|
||||
break;
|
||||
case 4:
|
||||
++currentX;
|
||||
break;
|
||||
case 5:
|
||||
--currentX;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static boolean canBlockReplaceAt(World world, int x, int y, int z, Block block)
|
||||
{
|
||||
return world.getBlock(x, y, z) != null &&
|
||||
|
||||
Reference in new issue
Block a user