This commit is contained in:
eaglercraft 2024-03-02 22:18:18 -08:00
commit 573420e1b8
613 changed files with 5708 additions and 4445 deletions

View file

@ -1,5 +1,7 @@
package net.minecraft.block;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.minecraft.block.material.Material;
@ -129,7 +131,9 @@ public class BlockBed extends BlockDirectional {
}
private EntityPlayer getPlayerInBed(World worldIn, BlockPos pos) {
for (EntityPlayer entityplayer : worldIn.playerEntities) {
List<EntityPlayer> playerEntities = worldIn.playerEntities;
for (int i = 0, l = playerEntities.size(); i < l; ++i) {
EntityPlayer entityplayer = playerEntities.get(i);
if (entityplayer.isPlayerSleeping() && entityplayer.playerLocation.equals(pos)) {
return entityplayer;
}

View file

@ -84,7 +84,9 @@ public abstract class BlockButton extends Block {
}
public boolean canPlaceBlockAt(World world, BlockPos blockpos) {
for (EnumFacing enumfacing : EnumFacing.values()) {
EnumFacing[] facings = EnumFacing._VALUES;
for (int i = 0; i < facings.length; ++i) {
EnumFacing enumfacing = facings[i];
if (func_181088_a(world, blockpos, enumfacing)) {
return true;
}

View file

@ -111,7 +111,9 @@ public class BlockCactus extends Block {
}
public boolean canBlockStay(World worldIn, BlockPos pos) {
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int i = 0; i < facings.length; ++i) {
EnumFacing enumfacing = facings[i];
if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock().getMaterial().isSolid()) {
return false;
}

View file

@ -1,5 +1,7 @@
package net.minecraft.block;
import java.util.List;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyDirection;
@ -96,7 +98,9 @@ public class BlockChest extends BlockContainer {
public void onBlockAdded(World world, BlockPos blockpos, IBlockState iblockstate) {
this.checkForSurroundingChests(world, blockpos, iblockstate);
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facings();
for (int i = 0; i < facings.length; ++i) {
EnumFacing enumfacing = facings[i];
BlockPos blockpos1 = blockpos.offset(enumfacing);
IBlockState iblockstate1 = world.getBlockState(blockpos1);
if (iblockstate1.getBlock() == this) {
@ -241,7 +245,9 @@ public class BlockChest extends BlockContainer {
public IBlockState correctFacing(World worldIn, BlockPos pos, IBlockState state) {
EnumFacing enumfacing = null;
for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) {
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int i = 0; i < facings.length; ++i) {
EnumFacing enumfacing1 = facings[i];
IBlockState iblockstate = worldIn.getBlockState(pos.offset(enumfacing1));
if (iblockstate.getBlock() == this) {
return state;
@ -322,7 +328,9 @@ public class BlockChest extends BlockContainer {
if (worldIn.getBlockState(pos).getBlock() != this) {
return false;
} else {
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int i = 0; i < facings.length; ++i) {
EnumFacing enumfacing = facings[i];
if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock() == this) {
return true;
}
@ -380,7 +388,9 @@ public class BlockChest extends BlockContainer {
if (this.isBlocked(worldIn, pos)) {
return null;
} else {
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int i = 0; i < facings.length; ++i) {
EnumFacing enumfacing = facings[i];
BlockPos blockpos = pos.offset(enumfacing);
Block block = worldIn.getBlockState(blockpos).getBlock();
if (block == this) {
@ -450,9 +460,11 @@ public class BlockChest extends BlockContainer {
}
private boolean isOcelotSittingOnChest(World worldIn, BlockPos pos) {
for (Entity entity : worldIn.getEntitiesWithinAABB(EntityOcelot.class,
List<Entity> entityList = worldIn.getEntitiesWithinAABB(EntityOcelot.class,
new AxisAlignedBB((double) pos.getX(), (double) (pos.getY() + 1), (double) pos.getZ(),
(double) (pos.getX() + 1), (double) (pos.getY() + 2), (double) (pos.getZ() + 1)))) {
(double) (pos.getX() + 1), (double) (pos.getY() + 2), (double) (pos.getZ() + 1)));
for (int i = 0, l = entityList.size(); i < l; ++i) {
Entity entity = entityList.get(i);
EntityOcelot entityocelot = (EntityOcelot) entity;
if (entityocelot.isSitting()) {
return true;

View file

@ -58,7 +58,9 @@ public class BlockColored extends Block {
* (eg: wood returns 4 blocks)
*/
public void getSubBlocks(Item item, CreativeTabs var2, List<ItemStack> list) {
for (EnumDyeColor enumdyecolor : EnumDyeColor.values()) {
EnumDyeColor[] colors = EnumDyeColor.META_LOOKUP;
for (int i = 0; i < colors.length; ++i) {
EnumDyeColor enumdyecolor = colors[i];
list.add(new ItemStack(item, 1, enumdyecolor.getMetadata()));
}

View file

@ -127,7 +127,7 @@ public class BlockDirt extends Block {
DIRT(0, "dirt", "default", MapColor.dirtColor), COARSE_DIRT(1, "coarse_dirt", "coarse", MapColor.dirtColor),
PODZOL(2, "podzol", MapColor.obsidianColor);
private static final BlockDirt.DirtType[] METADATA_LOOKUP = new BlockDirt.DirtType[values().length];
private static final BlockDirt.DirtType[] METADATA_LOOKUP = new BlockDirt.DirtType[3];
private final int metadata;
private final String name;
private final String unlocalizedName;
@ -173,8 +173,9 @@ public class BlockDirt extends Block {
}
static {
for (BlockDirt.DirtType blockdirt$dirttype : values()) {
METADATA_LOOKUP[blockdirt$dirttype.getMetadata()] = blockdirt$dirttype;
BlockDirt.DirtType[] types = values();
for (int i = 0; i < types.length; ++i) {
METADATA_LOOKUP[types[i].getMetadata()] = types[i];
}
}

View file

@ -245,8 +245,9 @@ public class BlockDoublePlant extends BlockBush implements IGrowable {
* (eg: wood returns 4 blocks)
*/
public void getSubBlocks(Item item, CreativeTabs var2, List<ItemStack> list) {
for (BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype : BlockDoublePlant.EnumPlantType.values()) {
list.add(new ItemStack(item, 1, blockdoubleplant$enumplanttype.getMeta()));
BlockDoublePlant.EnumPlantType[] types = BlockDoublePlant.EnumPlantType.META_LOOKUP;
for (int i = 0; i < types.length; ++i) {
list.add(new ItemStack(item, 1, types[i].getMeta()));
}
}
@ -334,7 +335,7 @@ public class BlockDoublePlant extends BlockBush implements IGrowable {
SUNFLOWER(0, "sunflower"), SYRINGA(1, "syringa"), GRASS(2, "double_grass", "grass"),
FERN(3, "double_fern", "fern"), ROSE(4, "double_rose", "rose"), PAEONIA(5, "paeonia");
private static final BlockDoublePlant.EnumPlantType[] META_LOOKUP = new BlockDoublePlant.EnumPlantType[values().length];
private static final BlockDoublePlant.EnumPlantType[] META_LOOKUP = new BlockDoublePlant.EnumPlantType[6];
private final int meta;
private final String name;
private final String unlocalizedName;
@ -374,8 +375,9 @@ public class BlockDoublePlant extends BlockBush implements IGrowable {
}
static {
for (BlockDoublePlant.EnumPlantType blockdoubleplant$enumplanttype : values()) {
META_LOOKUP[blockdoubleplant$enumplanttype.getMeta()] = blockdoubleplant$enumplanttype;
BlockDoublePlant.EnumPlantType[] types = BlockDoublePlant.EnumPlantType.values();
for (int i = 0; i < types.length; ++i) {
META_LOOKUP[types[i].getMeta()] = types[i];
}
}

View file

@ -56,7 +56,9 @@ public class BlockDynamicLiquid extends BlockLiquid {
int k = -100;
this.adjacentSourceBlocks = 0;
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int m = 0; m < facings.length; ++m) {
EnumFacing enumfacing = facings[m];
k = this.checkAdjacentBlock(world, blockpos.offset(enumfacing), k);
}
@ -156,7 +158,9 @@ public class BlockDynamicLiquid extends BlockLiquid {
private int func_176374_a(World worldIn, BlockPos pos, int distance, EnumFacing calculateFlowCost) {
int i = 1000;
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int l = 0; l < facings.length; ++l) {
EnumFacing enumfacing = facings[l];
if (enumfacing != calculateFlowCost) {
BlockPos blockpos = pos.offset(enumfacing);
IBlockState iblockstate = worldIn.getBlockState(blockpos);
@ -187,7 +191,9 @@ public class BlockDynamicLiquid extends BlockLiquid {
int i = 1000;
EnumSet enumset = EnumSet.noneOf(EnumFacing.class);
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int k = 0; k < facings.length; ++k) {
EnumFacing enumfacing = facings[k];
BlockPos blockpos = pos.offset(enumfacing);
IBlockState iblockstate = worldIn.getBlockState(blockpos);
if (!this.isBlocked(worldIn, blockpos, iblockstate)

View file

@ -297,7 +297,9 @@ public class BlockFire extends Block {
}
private boolean canNeighborCatchFire(World worldIn, BlockPos pos) {
for (EnumFacing enumfacing : EnumFacing.values()) {
EnumFacing[] facings = EnumFacing._VALUES;
for (int i = 0; i < facings.length; ++i) {
EnumFacing enumfacing = facings[i];
if (this.canCatchFire(worldIn, pos.offset(enumfacing))) {
return true;
}
@ -312,8 +314,9 @@ public class BlockFire extends Block {
} else {
int i = 0;
for (EnumFacing enumfacing : EnumFacing.values()) {
i = Math.max(this.getEncouragement(worldIn.getBlockState(pos.offset(enumfacing)).getBlock()), i);
EnumFacing[] facings = EnumFacing._VALUES;
for (int j = 0; j < facings.length; ++j) {
i = Math.max(this.getEncouragement(worldIn.getBlockState(pos.offset(facings[j])).getBlock()), i);
}
return i;

View file

@ -61,9 +61,9 @@ public abstract class BlockFlower extends BlockBush {
* (eg: wood returns 4 blocks)
*/
public void getSubBlocks(Item item, CreativeTabs var2, List<ItemStack> list) {
for (BlockFlower.EnumFlowerType blockflower$enumflowertype : BlockFlower.EnumFlowerType
.getTypes(this.getBlockType())) {
list.add(new ItemStack(item, 1, blockflower$enumflowertype.getMeta()));
BlockFlower.EnumFlowerType[] flowerTypes = BlockFlower.EnumFlowerType.getTypes(this.getBlockType());
for (int i = 0; i < flowerTypes.length; ++i) {
list.add(new ItemStack(item, 1, flowerTypes[i].getMeta()));
}
}
@ -130,8 +130,9 @@ public abstract class BlockFlower extends BlockBush {
PINK_TULIP(BlockFlower.EnumFlowerColor.RED, 7, "pink_tulip", "tulipPink"),
OXEYE_DAISY(BlockFlower.EnumFlowerColor.RED, 8, "oxeye_daisy", "oxeyeDaisy");
private static final BlockFlower.EnumFlowerType[][] TYPES_FOR_BLOCK = new BlockFlower.EnumFlowerType[BlockFlower.EnumFlowerColor
.values().length][];
public static final BlockFlower.EnumFlowerType[] _VALUES = EnumFlowerType.values();
private static final BlockFlower.EnumFlowerType[][] TYPES_FOR_BLOCK = new BlockFlower.EnumFlowerType[_VALUES.length][];
private final BlockFlower.EnumFlowerColor blockType;
private final int meta;
private final String name;
@ -185,7 +186,9 @@ public abstract class BlockFlower extends BlockBush {
}
static {
for (final BlockFlower.EnumFlowerColor blockflower$enumflowercolor : BlockFlower.EnumFlowerColor.values()) {
BlockFlower.EnumFlowerColor[] colors = BlockFlower.EnumFlowerColor.values();
for (int i = 0; i < colors.length; ++i) {
final BlockFlower.EnumFlowerColor blockflower$enumflowercolor = colors[i];
Collection collection = Collections2.filter(Lists.newArrayList(values()),
new Predicate<BlockFlower.EnumFlowerType>() {
public boolean apply(BlockFlower.EnumFlowerType blockflower$enumflowertype) {

View file

@ -148,8 +148,9 @@ public class BlockHugeMushroom extends Block {
}
static {
for (BlockHugeMushroom.EnumType blockhugemushroom$enumtype : values()) {
META_LOOKUP[blockhugemushroom$enumtype.getMetadata()] = blockhugemushroom$enumtype;
BlockHugeMushroom.EnumType[] types = values();
for (int i = 0; i < types.length; ++i) {
META_LOOKUP[types[i].getMetadata()] = types[i];
}
}

View file

@ -103,7 +103,9 @@ public class BlockLadder extends Block {
if (enumfacing.getAxis().isHorizontal() && this.canBlockStay(world, blockpos, enumfacing)) {
return this.getDefaultState().withProperty(FACING, enumfacing);
} else {
for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) {
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int i = 0; i < facings.length; ++i) {
EnumFacing enumfacing1 = facings[i];
if (this.canBlockStay(world, blockpos, enumfacing1)) {
return this.getDefaultState().withProperty(FACING, enumfacing1);
}

View file

@ -75,7 +75,9 @@ public class BlockLever extends Block {
}
public boolean canPlaceBlockAt(World world, BlockPos blockpos) {
for (EnumFacing enumfacing : EnumFacing.values()) {
EnumFacing[] facings = EnumFacing._VALUES;
for (int i = 0; i < facings.length; ++i) {
EnumFacing enumfacing = facings[i];
if (func_181090_a(world, blockpos, enumfacing)) {
return true;
}
@ -99,7 +101,9 @@ public class BlockLever extends Block {
return iblockstate.withProperty(FACING,
BlockLever.EnumOrientation.forFacings(enumfacing, entitylivingbase.getHorizontalFacing()));
} else {
for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) {
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int i = 0; i < facings.length; ++i) {
EnumFacing enumfacing1 = facings[i];
if (enumfacing1 != enumfacing && func_181090_a(world, blockpos, enumfacing1.getOpposite())) {
return iblockstate.withProperty(FACING,
BlockLever.EnumOrientation.forFacings(enumfacing1, entitylivingbase.getHorizontalFacing()));
@ -258,7 +262,7 @@ public class BlockLever extends Block {
SOUTH(3, "south", EnumFacing.SOUTH), NORTH(4, "north", EnumFacing.NORTH), UP_Z(5, "up_z", EnumFacing.UP),
UP_X(6, "up_x", EnumFacing.UP), DOWN_Z(7, "down_z", EnumFacing.DOWN);
private static final BlockLever.EnumOrientation[] META_LOOKUP = new BlockLever.EnumOrientation[values().length];
private static final BlockLever.EnumOrientation[] META_LOOKUP = new BlockLever.EnumOrientation[8];
private final int meta;
private final String name;
private final EnumFacing facing;
@ -329,8 +333,9 @@ public class BlockLever extends Block {
}
static {
for (BlockLever.EnumOrientation blocklever$enumorientation : values()) {
META_LOOKUP[blocklever$enumorientation.getMetadata()] = blocklever$enumorientation;
BlockLever.EnumOrientation[] orientations = values();
for (int i = 0; i < orientations.length; ++i) {
META_LOOKUP[orientations[i].getMetadata()] = orientations[i];
}
}

View file

@ -159,7 +159,9 @@ public abstract class BlockLiquid extends Block {
Vec3 vec3 = new Vec3(0.0D, 0.0D, 0.0D);
int i = this.getEffectiveFlowDecay(worldIn, pos);
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int m = 0; m < facings.length; ++m) {
EnumFacing enumfacing = facings[m];
BlockPos blockpos = pos.offset(enumfacing);
int j = this.getEffectiveFlowDecay(worldIn, blockpos);
if (j < 0) {
@ -180,7 +182,8 @@ public abstract class BlockLiquid extends Block {
}
if (((Integer) worldIn.getBlockState(pos).getValue(LEVEL)).intValue() >= 8) {
for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) {
for (int j = 0; j < facings.length; ++j) {
EnumFacing enumfacing1 = facings[j];
BlockPos blockpos1 = pos.offset(enumfacing1);
if (this.isBlockSolid(worldIn, blockpos1, enumfacing1)
|| this.isBlockSolid(worldIn, blockpos1.up(), enumfacing1)) {
@ -295,7 +298,9 @@ public abstract class BlockLiquid extends Block {
if (this.blockMaterial == Material.lava) {
boolean flag = false;
for (EnumFacing enumfacing : EnumFacing.values()) {
EnumFacing[] facings = EnumFacing._VALUES;
for (int j = 0; j < facings.length; ++j) {
EnumFacing enumfacing = facings[j];
if (enumfacing != EnumFacing.DOWN
&& worldIn.getBlockState(pos.offset(enumfacing)).getBlock().getMaterial() == Material.water) {
flag = true;

View file

@ -122,7 +122,9 @@ public class BlockPistonBase extends Block {
}
private boolean shouldBeExtended(World worldIn, BlockPos pos, EnumFacing facing) {
for (EnumFacing enumfacing : EnumFacing.values()) {
EnumFacing[] facings = EnumFacing._VALUES;
for (int i = 0; i < facings.length; ++i) {
EnumFacing enumfacing = facings[i];
if (enumfacing != facing && worldIn.isSidePowered(pos.offset(enumfacing), enumfacing)) {
return true;
}
@ -133,7 +135,8 @@ public class BlockPistonBase extends Block {
} else {
BlockPos blockpos = pos.up();
for (EnumFacing enumfacing1 : EnumFacing.values()) {
for (int i = 0; i < facings.length; ++i) {
EnumFacing enumfacing1 = facings[i];
if (enumfacing1 != EnumFacing.DOWN
&& worldIn.isSidePowered(blockpos.offset(enumfacing1), enumfacing1)) {
return true;

View file

@ -61,8 +61,9 @@ public class BlockPlanks extends Block {
* (eg: wood returns 4 blocks)
*/
public void getSubBlocks(Item item, CreativeTabs var2, List<ItemStack> list) {
for (BlockPlanks.EnumType blockplanks$enumtype : BlockPlanks.EnumType.values()) {
list.add(new ItemStack(item, 1, blockplanks$enumtype.getMetadata()));
BlockPlanks.EnumType[] types = BlockPlanks.EnumType.META_LOOKUP;
for (int i = 0; i < types.length; ++i) {
list.add(new ItemStack(item, 1, types[i].getMetadata()));
}
}
@ -97,7 +98,7 @@ public class BlockPlanks extends Block {
BIRCH(2, "birch", MapColor.sandColor), JUNGLE(3, "jungle", MapColor.dirtColor),
ACACIA(4, "acacia", MapColor.adobeColor), DARK_OAK(5, "dark_oak", "big_oak", MapColor.brownColor);
private static final BlockPlanks.EnumType[] META_LOOKUP = new BlockPlanks.EnumType[values().length];
public static final BlockPlanks.EnumType[] META_LOOKUP = new BlockPlanks.EnumType[6];
private final int meta;
private final String name;
private final String unlocalizedName;
@ -143,8 +144,9 @@ public class BlockPlanks extends Block {
}
static {
for (BlockPlanks.EnumType blockplanks$enumtype : values()) {
META_LOOKUP[blockplanks$enumtype.getMetadata()] = blockplanks$enumtype;
BlockPlanks.EnumType[] types = values();
for (int i = 0; i < types.length; ++i) {
META_LOOKUP[types[i].getMetadata()] = types[i];
}
}

View file

@ -258,11 +258,13 @@ public class BlockPortal extends BlockBreakable {
if (!blockportal$size.func_150860_b()) {
return new BlockPattern.PatternHelper(parBlockPos, EnumFacing.NORTH, EnumFacing.UP, loadingcache, 1, 1, 1);
} else {
int[] aint = new int[EnumFacing.AxisDirection.values().length];
EnumFacing.AxisDirection[] axis = EnumFacing.AxisDirection._VALUES;
int[] aint = new int[axis.length];
EnumFacing enumfacing = blockportal$size.field_150866_c.rotateYCCW();
BlockPos blockpos = blockportal$size.field_150861_f.up(blockportal$size.func_181100_a() - 1);
for (EnumFacing.AxisDirection enumfacing$axisdirection : EnumFacing.AxisDirection.values()) {
for (int k = 0; k < axis.length; ++k) {
EnumFacing.AxisDirection enumfacing$axisdirection = axis[k];
BlockPattern.PatternHelper blockpattern$patternhelper = new BlockPattern.PatternHelper(
enumfacing.getAxisDirection() == enumfacing$axisdirection ? blockpos
: blockpos.offset(blockportal$size.field_150866_c,
@ -283,7 +285,8 @@ public class BlockPortal extends BlockBreakable {
EnumFacing.AxisDirection enumfacing$axisdirection1 = EnumFacing.AxisDirection.POSITIVE;
for (EnumFacing.AxisDirection enumfacing$axisdirection2 : EnumFacing.AxisDirection.values()) {
for (int k = 0; k < axis.length; ++k) {
EnumFacing.AxisDirection enumfacing$axisdirection2 = axis[k];
if (aint[enumfacing$axisdirection2.ordinal()] < aint[enumfacing$axisdirection1.ordinal()]) {
enumfacing$axisdirection1 = enumfacing$axisdirection2;
}

View file

@ -66,7 +66,8 @@ public class BlockPressurePlate extends BlockBasePressurePlate {
}
if (!list.isEmpty()) {
for (Entity entity : list) {
for (int i = 0, l = list.size(); i < l; ++i) {
Entity entity = list.get(i);
if (!entity.doesEntityNotTriggerPressurePlate()) {
return 15;
}

View file

@ -108,7 +108,7 @@ public class BlockPrismarine extends Block {
public static enum EnumType implements IStringSerializable {
ROUGH(0, "prismarine", "rough"), BRICKS(1, "prismarine_bricks", "bricks"), DARK(2, "dark_prismarine", "dark");
private static final BlockPrismarine.EnumType[] META_LOOKUP = new BlockPrismarine.EnumType[values().length];
private static final BlockPrismarine.EnumType[] META_LOOKUP = new BlockPrismarine.EnumType[3];
private final int meta;
private final String name;
private final String unlocalizedName;
@ -144,8 +144,9 @@ public class BlockPrismarine extends Block {
}
static {
for (BlockPrismarine.EnumType blockprismarine$enumtype : values()) {
META_LOOKUP[blockprismarine$enumtype.getMetadata()] = blockprismarine$enumtype;
BlockPrismarine.EnumType[] types = values();
for (int i = 0; i < types.length; ++i) {
META_LOOKUP[types[i].getMetadata()] = types[i];
}
}

View file

@ -132,7 +132,7 @@ public class BlockQuartz extends Block {
DEFAULT(0, "default", "default"), CHISELED(1, "chiseled", "chiseled"), LINES_Y(2, "lines_y", "lines"),
LINES_X(3, "lines_x", "lines"), LINES_Z(4, "lines_z", "lines");
private static final BlockQuartz.EnumType[] META_LOOKUP = new BlockQuartz.EnumType[values().length];
private static final BlockQuartz.EnumType[] META_LOOKUP = new BlockQuartz.EnumType[5];
private final int meta;
private final String field_176805_h;
private final String unlocalizedName;
@ -164,8 +164,9 @@ public class BlockQuartz extends Block {
}
static {
for (BlockQuartz.EnumType blockquartz$enumtype : values()) {
META_LOOKUP[blockquartz$enumtype.getMetadata()] = blockquartz$enumtype;
BlockQuartz.EnumType[] types = values();
for (int i = 0; i < types.length; ++i) {
META_LOOKUP[types[i].getMetadata()] = types[i];
}
}

View file

@ -184,7 +184,7 @@ public abstract class BlockRailBase extends Block {
ASCENDING_SOUTH(5, "ascending_south"), SOUTH_EAST(6, "south_east"), SOUTH_WEST(7, "south_west"),
NORTH_WEST(8, "north_west"), NORTH_EAST(9, "north_east");
private static final BlockRailBase.EnumRailDirection[] META_LOOKUP = new BlockRailBase.EnumRailDirection[values().length];
private static final BlockRailBase.EnumRailDirection[] META_LOOKUP = new BlockRailBase.EnumRailDirection[10];
private final int meta;
private final String name;
@ -219,8 +219,9 @@ public abstract class BlockRailBase extends Block {
}
static {
for (BlockRailBase.EnumRailDirection blockrailbase$enumraildirection : values()) {
META_LOOKUP[blockrailbase$enumraildirection.getMetadata()] = blockrailbase$enumraildirection;
BlockRailBase.EnumRailDirection[] directions = values();
for (int i = 0; i < directions.length; ++i) {
META_LOOKUP[directions[i].getMetadata()] = directions[i];
}
}
@ -345,8 +346,10 @@ public abstract class BlockRailBase extends Block {
protected int countAdjacentRails() {
int i = 0;
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
if (this.hasRailAt(this.pos.offset(enumfacing))) {
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
BlockPos tmp = new BlockPos(0, 0, 0);
for (int j = 0; j < facings.length; ++j) {
if (this.hasRailAt(this.pos.offsetEvenFaster(facings[j], tmp))) {
++i;
}
}

View file

@ -43,7 +43,6 @@ import net.minecraft.world.World;
*
*/
public class BlockRailDetector extends BlockRailBase {
public static PropertyEnum<BlockRailBase.EnumRailDirection> SHAPE;
public static final PropertyBool POWERED = PropertyBool.create("powered");

View file

@ -60,8 +60,9 @@ public class BlockRedSandstone extends Block {
* (eg: wood returns 4 blocks)
*/
public void getSubBlocks(Item item, CreativeTabs var2, List<ItemStack> list) {
for (BlockRedSandstone.EnumType blockredsandstone$enumtype : BlockRedSandstone.EnumType.values()) {
list.add(new ItemStack(item, 1, blockredsandstone$enumtype.getMetadata()));
BlockRedSandstone.EnumType[] types = BlockRedSandstone.EnumType.META_LOOKUP;
for (int i = 0; i < types.length; ++i) {
list.add(new ItemStack(item, 1, types[i].getMetadata()));
}
}
@ -88,7 +89,7 @@ public class BlockRedSandstone extends Block {
DEFAULT(0, "red_sandstone", "default"), CHISELED(1, "chiseled_red_sandstone", "chiseled"),
SMOOTH(2, "smooth_red_sandstone", "smooth");
private static final BlockRedSandstone.EnumType[] META_LOOKUP = new BlockRedSandstone.EnumType[values().length];
public static final BlockRedSandstone.EnumType[] META_LOOKUP = new BlockRedSandstone.EnumType[3];
private final int meta;
private final String name;
private final String unlocalizedName;
@ -124,8 +125,9 @@ public class BlockRedSandstone extends Block {
}
static {
for (BlockRedSandstone.EnumType blockredsandstone$enumtype : values()) {
META_LOOKUP[blockredsandstone$enumtype.getMetadata()] = blockredsandstone$enumtype;
BlockRedSandstone.EnumType[] types = values();
for (int i = 0; i < types.length; ++i) {
META_LOOKUP[types[i].getMetadata()] = types[i];
}
}

View file

@ -109,8 +109,10 @@ public abstract class BlockRedstoneDiode extends BlockDirectional {
this.dropBlockAsItem(world, blockpos, iblockstate, 0);
world.setBlockToAir(blockpos);
for (EnumFacing enumfacing : EnumFacing.values()) {
world.notifyNeighborsOfStateChange(blockpos.offset(enumfacing), this);
EnumFacing[] facings = EnumFacing._VALUES;
BlockPos tmp = new BlockPos(0, 0, 0);
for (int i = 0; i < facings.length; ++i) {
world.notifyNeighborsOfStateChange(blockpos.offsetEvenFaster(facings[i], tmp), this);
}
}
@ -219,8 +221,10 @@ public abstract class BlockRedstoneDiode extends BlockDirectional {
*/
public void onBlockDestroyedByPlayer(World world, BlockPos blockpos, IBlockState iblockstate) {
if (this.isRepeaterPowered) {
for (EnumFacing enumfacing : EnumFacing.values()) {
world.notifyNeighborsOfStateChange(blockpos.offset(enumfacing), this);
EnumFacing[] facings = EnumFacing._VALUES;
BlockPos tmp = new BlockPos(0, 0, 0);
for (int i = 0; i < facings.length; ++i) {
world.notifyNeighborsOfStateChange(blockpos.offsetEvenFaster(facings[i], tmp), this);
}
}

View file

@ -81,8 +81,10 @@ public class BlockRedstoneTorch extends BlockTorch {
public void onBlockAdded(World world, BlockPos blockpos, IBlockState var3) {
if (this.isOn) {
for (EnumFacing enumfacing : EnumFacing.values()) {
world.notifyNeighborsOfStateChange(blockpos.offset(enumfacing), this);
EnumFacing[] facings = EnumFacing._VALUES;
BlockPos tmp = new BlockPos(0, 0, 0);
for (int i = 0; i < facings.length; ++i) {
world.notifyNeighborsOfStateChange(blockpos.offsetEvenFaster(facings[i], tmp), this);
}
}
@ -90,8 +92,10 @@ public class BlockRedstoneTorch extends BlockTorch {
public void breakBlock(World world, BlockPos blockpos, IBlockState var3) {
if (this.isOn) {
for (EnumFacing enumfacing : EnumFacing.values()) {
world.notifyNeighborsOfStateChange(blockpos.offset(enumfacing), this);
EnumFacing[] facings = EnumFacing._VALUES;
BlockPos tmp = new BlockPos(0, 0, 0);
for (int i = 0; i < facings.length; ++i) {
world.notifyNeighborsOfStateChange(blockpos.offsetEvenFaster(facings[i], tmp), this);
}
}

View file

@ -96,12 +96,13 @@ public class BlockRedstoneWire extends Block {
private BlockRedstoneWire.EnumAttachPosition getAttachPosition(IBlockAccess worldIn, BlockPos pos,
EnumFacing direction) {
BlockPos blockpos = pos.offset(direction);
Block block = worldIn.getBlockState(pos.offset(direction)).getBlock();
if (!canConnectTo(worldIn.getBlockState(blockpos), direction)
&& (block.isBlockNormalCube() || !canConnectUpwardsTo(worldIn.getBlockState(blockpos.down())))) {
BlockPos posTmp = new BlockPos(0, 0, 0);
Block block = worldIn.getBlockState(blockpos).getBlock();
if (!canConnectTo(worldIn.getBlockState(blockpos), direction) && (block.isBlockNormalCube()
|| !canConnectUpwardsTo(worldIn.getBlockState(blockpos.offsetEvenFaster(EnumFacing.UP, posTmp))))) {
Block block1 = worldIn.getBlockState(pos.up()).getBlock();
return !block1.isBlockNormalCube() && block.isBlockNormalCube()
&& canConnectUpwardsTo(worldIn.getBlockState(blockpos.up()))
&& canConnectUpwardsTo(worldIn.getBlockState(blockpos.offsetEvenFaster(EnumFacing.UP, posTmp)))
? BlockRedstoneWire.EnumAttachPosition.UP
: BlockRedstoneWire.EnumAttachPosition.NONE;
} else {
@ -132,8 +133,9 @@ public class BlockRedstoneWire extends Block {
}
public boolean canPlaceBlockAt(World world, BlockPos blockpos) {
return World.doesBlockHaveSolidTopSurface(world, blockpos.down())
|| world.getBlockState(blockpos.down()).getBlock() == Blocks.glowstone;
BlockPos fuckOff = blockpos.down();
return World.doesBlockHaveSolidTopSurface(world, fuckOff)
|| world.getBlockState(fuckOff).getBlock() == Blocks.glowstone;
}
private IBlockState updateSurroundingRedstone(World worldIn, BlockPos pos, IBlockState state) {
@ -141,8 +143,8 @@ public class BlockRedstoneWire extends Block {
ArrayList<BlockPos> arraylist = Lists.newArrayList(this.blocksNeedingUpdate);
this.blocksNeedingUpdate.clear();
for (BlockPos blockpos : arraylist) {
worldIn.notifyNeighborsOfStateChange(blockpos, this);
for (int i = 0, l = arraylist.size(); i < l; ++i) {
worldIn.notifyNeighborsOfStateChange(arraylist.get(i), this);
}
return state;
@ -162,9 +164,12 @@ public class BlockRedstoneWire extends Block {
int l = 0;
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
BlockPos blockpos = pos1.offset(enumfacing);
boolean flag = blockpos.getX() != pos2.getX() || blockpos.getZ() != pos2.getZ();
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
BlockPos tmp = new BlockPos(0, 0, 0);
for (int m = 0; m < facings.length; ++m) {
EnumFacing enumfacing = facings[m];
BlockPos blockpos = pos1.offsetEvenFaster(enumfacing, tmp);
boolean flag = blockpos.x != pos2.x || blockpos.z != pos2.z;
if (flag) {
l = this.getMaxCurrentStrength(worldIn, blockpos, l);
}
@ -200,8 +205,8 @@ public class BlockRedstoneWire extends Block {
this.blocksNeedingUpdate.add(pos1);
for (EnumFacing enumfacing1 : EnumFacing.values()) {
this.blocksNeedingUpdate.add(pos1.offset(enumfacing1));
for (int m = 0; m < facings.length; ++m) {
this.blocksNeedingUpdate.add(pos1.offset(facings[m]));
}
}
@ -217,8 +222,10 @@ public class BlockRedstoneWire extends Block {
if (worldIn.getBlockState(pos).getBlock() == this) {
worldIn.notifyNeighborsOfStateChange(pos, this);
for (EnumFacing enumfacing : EnumFacing.values()) {
worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this);
EnumFacing[] facings = EnumFacing._VALUES;
BlockPos tmp = new BlockPos(0, 0, 0);
for (int i = 0; i < facings.length; ++i) {
worldIn.notifyNeighborsOfStateChange(pos.offsetEvenFaster(facings[i], tmp), this);
}
}
@ -228,20 +235,25 @@ public class BlockRedstoneWire extends Block {
if (!world.isRemote) {
this.updateSurroundingRedstone(world, blockpos, iblockstate);
for (EnumFacing enumfacing : EnumFacing.Plane.VERTICAL) {
world.notifyNeighborsOfStateChange(blockpos.offset(enumfacing), this);
BlockPos tmp = new BlockPos(0, 0, 0);
EnumFacing[] facings = EnumFacing.Plane.VERTICAL.facingsArray;
for (int i = 0; i < facings.length; ++i) {
world.notifyNeighborsOfStateChange(blockpos.offsetEvenFaster(facings[i], tmp), this);
}
for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) {
this.notifyWireNeighborsOfStateChange(world, blockpos.offset(enumfacing1));
facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int i = 0; i < facings.length; ++i) {
this.notifyWireNeighborsOfStateChange(world, blockpos.offsetEvenFaster(facings[i], tmp));
}
for (EnumFacing enumfacing2 : EnumFacing.Plane.HORIZONTAL) {
BlockPos blockpos1 = blockpos.offset(enumfacing2);
for (int i = 0; i < facings.length; ++i) {
BlockPos blockpos1 = blockpos.offsetEvenFaster(facings[i], tmp);
if (world.getBlockState(blockpos1).getBlock().isNormalCube()) {
this.notifyWireNeighborsOfStateChange(world, blockpos1.up());
++blockpos1.y;
this.notifyWireNeighborsOfStateChange(world, blockpos1);
} else {
this.notifyWireNeighborsOfStateChange(world, blockpos1.down());
--blockpos1.y;
this.notifyWireNeighborsOfStateChange(world, blockpos1);
}
}
}
@ -250,22 +262,28 @@ public class BlockRedstoneWire extends Block {
public void breakBlock(World world, BlockPos blockpos, IBlockState iblockstate) {
super.breakBlock(world, blockpos, iblockstate);
if (!world.isRemote) {
for (EnumFacing enumfacing : EnumFacing.values()) {
world.notifyNeighborsOfStateChange(blockpos.offset(enumfacing), this);
BlockPos tmp = new BlockPos(0, 0, 0);
EnumFacing[] facings = EnumFacing._VALUES;
for (int i = 0; i < facings.length; ++i) {
world.notifyNeighborsOfStateChange(blockpos.offsetEvenFaster(facings[i], tmp), this);
}
this.updateSurroundingRedstone(world, blockpos, iblockstate);
for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) {
this.notifyWireNeighborsOfStateChange(world, blockpos.offset(enumfacing1));
facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int i = 0; i < facings.length; ++i) {
this.notifyWireNeighborsOfStateChange(world, blockpos.offsetEvenFaster(facings[i], tmp));
}
for (EnumFacing enumfacing2 : EnumFacing.Plane.HORIZONTAL) {
BlockPos blockpos1 = blockpos.offset(enumfacing2);
facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int i = 0; i < facings.length; ++i) {
BlockPos blockpos1 = blockpos.offsetEvenFaster(facings[i], tmp);
if (world.getBlockState(blockpos1).getBlock().isNormalCube()) {
this.notifyWireNeighborsOfStateChange(world, blockpos1.up());
++blockpos1.y;
this.notifyWireNeighborsOfStateChange(world, blockpos1);
} else {
this.notifyWireNeighborsOfStateChange(world, blockpos1.down());
--blockpos1.y;
this.notifyWireNeighborsOfStateChange(world, blockpos1);
}
}
}
@ -319,7 +337,9 @@ public class BlockRedstoneWire extends Block {
} else {
EnumSet enumset = EnumSet.noneOf(EnumFacing.class);
for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) {
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int j = 0; j < facings.length; ++j) {
EnumFacing enumfacing1 = facings[j];
if (this.func_176339_d(iblockaccess, blockpos, enumfacing1)) {
enumset.add(enumfacing1);
}

View file

@ -49,18 +49,20 @@ public class BlockReed extends Block {
}
public void updateTick(World world, BlockPos blockpos, IBlockState iblockstate, EaglercraftRandom var4) {
if (world.getBlockState(blockpos.down()).getBlock() == Blocks.reeds
BlockPos tmp = new BlockPos(0, 0, 0);
if (world.getBlockState(blockpos.offsetEvenFaster(EnumFacing.DOWN, tmp)).getBlock() == Blocks.reeds
|| this.checkForDrop(world, blockpos, iblockstate)) {
if (world.isAirBlock(blockpos.up())) {
if (world.isAirBlock(blockpos.offsetEvenFaster(EnumFacing.UP, tmp))) {
int i;
for (i = 1; world.getBlockState(blockpos.down(i)).getBlock() == this; ++i) {
--tmp.y;
for (i = 1; world.getBlockState(tmp.offsetEvenFaster(EnumFacing.DOWN, tmp)).getBlock() == this; ++i) {
;
}
if (i < 3) {
int j = ((Integer) iblockstate.getValue(AGE)).intValue();
if (j == 15) {
world.setBlockState(blockpos.up(), this.getDefaultState());
world.setBlockState(blockpos.offsetEvenFaster(EnumFacing.UP, tmp), this.getDefaultState());
world.setBlockState(blockpos, iblockstate.withProperty(AGE, Integer.valueOf(0)), 4);
} else {
world.setBlockState(blockpos, iblockstate.withProperty(AGE, Integer.valueOf(j + 1)), 4);
@ -72,15 +74,19 @@ public class BlockReed extends Block {
}
public boolean canPlaceBlockAt(World world, BlockPos blockpos) {
Block block = world.getBlockState(blockpos.down()).getBlock();
BlockPos down = blockpos.down();
Block block = world.getBlockState(down).getBlock();
if (block == this) {
return true;
} else if (block != Blocks.grass && block != Blocks.dirt && block != Blocks.sand) {
return false;
} else {
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
if (world.getBlockState(blockpos.offset(enumfacing).down()).getBlock()
.getMaterial() == Material.water) {
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int i = 0; i < facings.length; ++i) {
EnumFacing enumfacing = facings[i];
down = blockpos.offsetEvenFaster(enumfacing, down);
--down.y;
if (world.getBlockState(down).getBlock().getMaterial() == Material.water) {
return true;
}
}

View file

@ -58,8 +58,9 @@ public class BlockSand extends BlockFalling {
* (eg: wood returns 4 blocks)
*/
public void getSubBlocks(Item item, CreativeTabs var2, List<ItemStack> list) {
for (BlockSand.EnumType blocksand$enumtype : BlockSand.EnumType.values()) {
list.add(new ItemStack(item, 1, blocksand$enumtype.getMetadata()));
BlockSand.EnumType[] blocks = BlockSand.EnumType.META_LOOKUP;
for (int i = 0; i < blocks.length; ++i) {
list.add(new ItemStack(item, 1, blocks[i].getMetadata()));
}
}
@ -92,7 +93,7 @@ public class BlockSand extends BlockFalling {
public static enum EnumType implements IStringSerializable {
SAND(0, "sand", "default", MapColor.sandColor), RED_SAND(1, "red_sand", "red", MapColor.adobeColor);
private static final BlockSand.EnumType[] META_LOOKUP = new BlockSand.EnumType[values().length];
public static final BlockSand.EnumType[] META_LOOKUP = new BlockSand.EnumType[2];
private final int meta;
private final String name;
private final MapColor mapColor;
@ -137,8 +138,9 @@ public class BlockSand extends BlockFalling {
}
static {
for (BlockSand.EnumType blocksand$enumtype : values()) {
META_LOOKUP[blocksand$enumtype.getMetadata()] = blocksand$enumtype;
BlockSand.EnumType[] types = values();
for (int i = 0; i < types.length; ++i) {
META_LOOKUP[types[i].getMetadata()] = types[i];
}
}

View file

@ -61,8 +61,9 @@ public class BlockSandStone extends Block {
* (eg: wood returns 4 blocks)
*/
public void getSubBlocks(Item item, CreativeTabs var2, List<ItemStack> list) {
for (BlockSandStone.EnumType blocksandstone$enumtype : BlockSandStone.EnumType.values()) {
list.add(new ItemStack(item, 1, blocksandstone$enumtype.getMetadata()));
BlockSandStone.EnumType[] types = BlockSandStone.EnumType.META_LOOKUP;
for (int i = 0; i < types.length; ++i) {
list.add(new ItemStack(item, 1, types[i].getMetadata()));
}
}
@ -96,7 +97,7 @@ public class BlockSandStone extends Block {
DEFAULT(0, "sandstone", "default"), CHISELED(1, "chiseled_sandstone", "chiseled"),
SMOOTH(2, "smooth_sandstone", "smooth");
private static final BlockSandStone.EnumType[] META_LOOKUP = new BlockSandStone.EnumType[values().length];
public static final BlockSandStone.EnumType[] META_LOOKUP = new BlockSandStone.EnumType[3];
private final int metadata;
private final String name;
private final String unlocalizedName;
@ -132,8 +133,9 @@ public class BlockSandStone extends Block {
}
static {
for (BlockSandStone.EnumType blocksandstone$enumtype : values()) {
META_LOOKUP[blocksandstone$enumtype.getMetadata()] = blocksandstone$enumtype;
BlockSandStone.EnumType[] types = values();
for (int i = 0; i < types.length; ++i) {
META_LOOKUP[types[i].getMetadata()] = types[i];
}
}

View file

@ -212,8 +212,9 @@ public class BlockSapling extends BlockBush implements IGrowable {
* (eg: wood returns 4 blocks)
*/
public void getSubBlocks(Item item, CreativeTabs var2, List<ItemStack> list) {
for (BlockPlanks.EnumType blockplanks$enumtype : BlockPlanks.EnumType.values()) {
list.add(new ItemStack(item, 1, blockplanks$enumtype.getMetadata()));
BlockPlanks.EnumType[] types = BlockPlanks.EnumType.META_LOOKUP;
for (int i = 0; i < types.length; ++i) {
list.add(new ItemStack(item, 1, types[i].getMetadata()));
}
}

View file

@ -105,8 +105,9 @@ public class BlockSilverfish extends Block {
* (eg: wood returns 4 blocks)
*/
public void getSubBlocks(Item item, CreativeTabs var2, List<ItemStack> list) {
for (BlockSilverfish.EnumType blocksilverfish$enumtype : BlockSilverfish.EnumType.values()) {
list.add(new ItemStack(item, 1, blocksilverfish$enumtype.getMetadata()));
BlockSilverfish.EnumType[] types = BlockSilverfish.EnumType.META_LOOKUP;
for (int i = 0; i < types.length; ++i) {
list.add(new ItemStack(item, 1, types[i].getMetadata()));
}
}
@ -165,7 +166,7 @@ public class BlockSilverfish extends Block {
}
};
private static final BlockSilverfish.EnumType[] META_LOOKUP = new BlockSilverfish.EnumType[values().length];
public static final BlockSilverfish.EnumType[] META_LOOKUP = new BlockSilverfish.EnumType[6];
private final int meta;
private final String name;
private final String unlocalizedName;
@ -207,7 +208,9 @@ public class BlockSilverfish extends Block {
public abstract IBlockState getModelBlock();
public static BlockSilverfish.EnumType forModelBlock(IBlockState model) {
for (BlockSilverfish.EnumType blocksilverfish$enumtype : values()) {
BlockSilverfish.EnumType[] types = BlockSilverfish.EnumType.META_LOOKUP;
for (int i = 0; i < types.length; ++i) {
BlockSilverfish.EnumType blocksilverfish$enumtype = types[i];
if (model == blocksilverfish$enumtype.getModelBlock()) {
return blocksilverfish$enumtype;
}
@ -217,8 +220,9 @@ public class BlockSilverfish extends Block {
}
static {
for (BlockSilverfish.EnumType blocksilverfish$enumtype : values()) {
META_LOOKUP[blocksilverfish$enumtype.getMetadata()] = blocksilverfish$enumtype;
BlockSilverfish.EnumType[] types = BlockSilverfish.EnumType.values();
for (int i = 0; i < types.length; ++i) {
META_LOOKUP[types[i].getMetadata()] = types[i];
}
}

View file

@ -2,6 +2,8 @@ package net.minecraft.block;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import java.util.List;
import com.google.common.base.Predicate;
import net.minecraft.block.material.Material;
@ -228,9 +230,10 @@ public class BlockSkull extends BlockContainer {
: 90.0F;
entitywither.func_82206_m();
for (EntityPlayer entityplayer : worldIn.getEntitiesWithinAABB(EntityPlayer.class,
entitywither.getEntityBoundingBox().expand(50.0D, 50.0D, 50.0D))) {
entityplayer.triggerAchievement(AchievementList.spawnWither);
List<EntityPlayer> list = worldIn.getEntitiesWithinAABB(EntityPlayer.class,
entitywither.getEntityBoundingBox().expand(50.0D, 50.0D, 50.0D));
for (int j = 0, l = list.size(); j < l; ++j) {
list.get(j).triggerAchievement(AchievementList.spawnWither);
}
worldIn.spawnEntityInWorld(entitywither);

View file

@ -96,13 +96,16 @@ public class BlockSponge extends Block {
linkedlist.add(new Tuple(pos, Integer.valueOf(0)));
int i = 0;
BlockPos tmp = new BlockPos(0, 0, 0);
while (!linkedlist.isEmpty()) {
Tuple tuple = (Tuple) linkedlist.poll();
BlockPos blockpos = (BlockPos) tuple.getFirst();
int j = ((Integer) tuple.getSecond()).intValue();
for (EnumFacing enumfacing : EnumFacing.values()) {
BlockPos blockpos1 = blockpos.offset(enumfacing);
EnumFacing[] facings = EnumFacing._VALUES;
for (int k = 0; k < facings.length; ++k) {
EnumFacing enumfacing = facings[k];
BlockPos blockpos1 = blockpos.offsetEvenFaster(enumfacing, tmp);
if (worldIn.getBlockState(blockpos1).getBlock().getMaterial() == Material.water) {
worldIn.setBlockState(blockpos1, Blocks.air.getDefaultState(), 2);
arraylist.add(blockpos1);
@ -118,8 +121,8 @@ public class BlockSponge extends Block {
}
}
for (BlockPos blockpos2 : arraylist) {
worldIn.notifyNeighborsOfStateChange(blockpos2, Blocks.air);
for (int j = 0, l = arraylist.size(); j < l; ++j) {
worldIn.notifyNeighborsOfStateChange(arraylist.get(j), Blocks.air);
}
return i > 0;

View file

@ -62,8 +62,9 @@ public class BlockStainedGlass extends BlockBreakable {
* (eg: wood returns 4 blocks)
*/
public void getSubBlocks(Item item, CreativeTabs var2, List<ItemStack> list) {
for (EnumDyeColor enumdyecolor : EnumDyeColor.values()) {
list.add(new ItemStack(item, 1, enumdyecolor.getMetadata()));
EnumDyeColor[] colors = EnumDyeColor.META_LOOKUP;
for (int i = 0; i < colors.length; ++i) {
list.add(new ItemStack(item, 1, colors[i].getMetadata()));
}
}

View file

@ -63,7 +63,7 @@ public class BlockStainedGlassPane extends BlockPane {
* (eg: wood returns 4 blocks)
*/
public void getSubBlocks(Item item, CreativeTabs var2, List<ItemStack> list) {
for (int i = 0; i < EnumDyeColor.values().length; ++i) {
for (int i = 0; i < EnumDyeColor.META_LOOKUP.length; ++i) {
list.add(new ItemStack(item, 1, i));
}

View file

@ -587,14 +587,15 @@ public class BlockStairs extends Block {
}
}
for (int k : aint) {
amovingobjectposition[k] = null;
for (int l = 0; l < aint.length; ++l) {
amovingobjectposition[aint[l]] = null;
}
MovingObjectPosition movingobjectposition1 = null;
double d1 = 0.0D;
for (MovingObjectPosition movingobjectposition : amovingobjectposition) {
for (int l = 0; l < amovingobjectposition.length; ++l) {
MovingObjectPosition movingobjectposition = amovingobjectposition[l];
if (movingobjectposition != null) {
double d0 = movingobjectposition.hitVec.squareDistanceTo(vec31);
if (d0 > d1) {

View file

@ -88,7 +88,9 @@ public class BlockStaticLiquid extends BlockLiquid {
}
protected boolean isSurroundingBlockFlammable(World worldIn, BlockPos pos) {
for (EnumFacing enumfacing : EnumFacing.values()) {
EnumFacing[] facings = EnumFacing._VALUES;
for (int i = 0; i < facings.length; ++i) {
EnumFacing enumfacing = facings[i];
if (this.getCanBlockBurn(worldIn, pos.offset(enumfacing))) {
return true;
}

View file

@ -68,8 +68,11 @@ public class BlockStem extends BlockBush implements IGrowable {
public IBlockState getActualState(IBlockState iblockstate, IBlockAccess iblockaccess, BlockPos blockpos) {
iblockstate = iblockstate.withProperty(FACING, EnumFacing.UP);
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
if (iblockaccess.getBlockState(blockpos.offset(enumfacing)).getBlock() == this.crop) {
BlockPos tmp = new BlockPos(0, 0, 0);
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int i = 0; i < facings.length; ++i) {
EnumFacing enumfacing = facings[i];
if (iblockaccess.getBlockState(blockpos.offsetEvenFaster(enumfacing, tmp)).getBlock() == this.crop) {
iblockstate = iblockstate.withProperty(FACING, enumfacing);
break;
}
@ -95,8 +98,9 @@ public class BlockStem extends BlockBush implements IGrowable {
iblockstate = iblockstate.withProperty(AGE, Integer.valueOf(i + 1));
world.setBlockState(blockpos, iblockstate, 2);
} else {
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
if (world.getBlockState(blockpos.offset(enumfacing)).getBlock() == this.crop) {
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int j = 0; j < facings.length; ++j) {
if (world.getBlockState(blockpos.offset(facings[j])).getBlock() == this.crop) {
return;
}
}

View file

@ -88,8 +88,9 @@ public class BlockStone extends Block {
* (eg: wood returns 4 blocks)
*/
public void getSubBlocks(Item item, CreativeTabs var2, List<ItemStack> list) {
for (BlockStone.EnumType blockstone$enumtype : BlockStone.EnumType.values()) {
list.add(new ItemStack(item, 1, blockstone$enumtype.getMetadata()));
BlockStone.EnumType[] types = BlockStone.EnumType.META_LOOKUP;
for (int i = 0; i < types.length; ++i) {
list.add(new ItemStack(item, 1, types[i].getMetadata()));
}
}
@ -120,7 +121,7 @@ public class BlockStone extends Block {
ANDESITE(5, MapColor.stoneColor, "andesite"),
ANDESITE_SMOOTH(6, MapColor.stoneColor, "smooth_andesite", "andesiteSmooth");
private static final BlockStone.EnumType[] META_LOOKUP = new BlockStone.EnumType[values().length];
public static final BlockStone.EnumType[] META_LOOKUP = new BlockStone.EnumType[7];
private final int meta;
private final String name;
private final String unlocalizedName;
@ -166,8 +167,9 @@ public class BlockStone extends Block {
}
static {
for (BlockStone.EnumType blockstone$enumtype : values()) {
META_LOOKUP[blockstone$enumtype.getMetadata()] = blockstone$enumtype;
BlockStone.EnumType[] types = values();
for (int i = 0; i < types.length; ++i) {
META_LOOKUP[types[i].getMetadata()] = types[i];
}
}

View file

@ -64,8 +64,9 @@ public class BlockStoneBrick extends Block {
* (eg: wood returns 4 blocks)
*/
public void getSubBlocks(Item item, CreativeTabs var2, List<ItemStack> list) {
for (BlockStoneBrick.EnumType blockstonebrick$enumtype : BlockStoneBrick.EnumType.values()) {
list.add(new ItemStack(item, 1, blockstonebrick$enumtype.getMetadata()));
BlockStoneBrick.EnumType[] types = BlockStoneBrick.EnumType.META_LOOKUP;
for (int i = 0; i < types.length; ++i) {
list.add(new ItemStack(item, 1, types[i].getMetadata()));
}
}
@ -92,7 +93,7 @@ public class BlockStoneBrick extends Block {
DEFAULT(0, "stonebrick", "default"), MOSSY(1, "mossy_stonebrick", "mossy"),
CRACKED(2, "cracked_stonebrick", "cracked"), CHISELED(3, "chiseled_stonebrick", "chiseled");
private static final BlockStoneBrick.EnumType[] META_LOOKUP = new BlockStoneBrick.EnumType[values().length];
public static final BlockStoneBrick.EnumType[] META_LOOKUP = new BlockStoneBrick.EnumType[4];
private final int meta;
private final String name;
private final String unlocalizedName;
@ -128,8 +129,9 @@ public class BlockStoneBrick extends Block {
}
static {
for (BlockStoneBrick.EnumType blockstonebrick$enumtype : values()) {
META_LOOKUP[blockstonebrick$enumtype.getMetadata()] = blockstonebrick$enumtype;
BlockStoneBrick.EnumType[] types = values();
for (int i = 0; i < types.length; ++i) {
META_LOOKUP[types[i].getMetadata()] = types[i];
}
}

View file

@ -91,7 +91,9 @@ public abstract class BlockStoneSlab extends BlockSlab {
*/
public void getSubBlocks(Item item, CreativeTabs var2, List<ItemStack> list) {
if (item != Item.getItemFromBlock(Blocks.double_stone_slab)) {
for (BlockStoneSlab.EnumType blockstoneslab$enumtype : BlockStoneSlab.EnumType.values()) {
BlockStoneSlab.EnumType[] types = BlockStoneSlab.EnumType.META_LOOKUP;
for (int i = 0; i < types.length; ++i) {
BlockStoneSlab.EnumType blockstoneslab$enumtype = types[i];
if (blockstoneslab$enumtype != BlockStoneSlab.EnumType.WOOD) {
list.add(new ItemStack(item, 1, blockstoneslab$enumtype.getMetadata()));
}
@ -162,7 +164,7 @@ public abstract class BlockStoneSlab extends BlockSlab {
NETHERBRICK(6, MapColor.netherrackColor, "nether_brick", "netherBrick"),
QUARTZ(7, MapColor.quartzColor, "quartz");
private static final BlockStoneSlab.EnumType[] META_LOOKUP = new BlockStoneSlab.EnumType[values().length];
public static final BlockStoneSlab.EnumType[] META_LOOKUP = new BlockStoneSlab.EnumType[8];
private final int meta;
private final MapColor field_181075_k;
private final String name;
@ -211,8 +213,9 @@ public abstract class BlockStoneSlab extends BlockSlab {
}
static {
for (BlockStoneSlab.EnumType blockstoneslab$enumtype : values()) {
META_LOOKUP[blockstoneslab$enumtype.getMetadata()] = blockstoneslab$enumtype;
BlockStoneSlab.EnumType[] types = values();
for (int i = 0; i < types.length; ++i) {
META_LOOKUP[types[i].getMetadata()] = types[i];
}
}

View file

@ -100,8 +100,9 @@ public abstract class BlockStoneSlabNew extends BlockSlab {
*/
public void getSubBlocks(Item item, CreativeTabs var2, List<ItemStack> list) {
if (item != Item.getItemFromBlock(Blocks.double_stone_slab2)) {
for (BlockStoneSlabNew.EnumType blockstoneslabnew$enumtype : BlockStoneSlabNew.EnumType.values()) {
list.add(new ItemStack(item, 1, blockstoneslabnew$enumtype.getMetadata()));
BlockStoneSlabNew.EnumType[] types = BlockStoneSlabNew.EnumType.META_LOOKUP;
for (int i = 0; i < types.length; ++i) {
list.add(new ItemStack(item, 1, types[i].getMetadata()));
}
}
@ -165,7 +166,7 @@ public abstract class BlockStoneSlabNew extends BlockSlab {
public static enum EnumType implements IStringSerializable {
RED_SANDSTONE(0, "red_sandstone", BlockSand.EnumType.RED_SAND.getMapColor());
private static final BlockStoneSlabNew.EnumType[] META_LOOKUP = new BlockStoneSlabNew.EnumType[values().length];
public static final BlockStoneSlabNew.EnumType[] META_LOOKUP = new BlockStoneSlabNew.EnumType[1];
private final int meta;
private final String name;
private final MapColor field_181069_e;
@ -208,8 +209,9 @@ public abstract class BlockStoneSlabNew extends BlockSlab {
}
static {
for (BlockStoneSlabNew.EnumType blockstoneslabnew$enumtype : values()) {
META_LOOKUP[blockstoneslabnew$enumtype.getMetadata()] = blockstoneslabnew$enumtype;
BlockStoneSlabNew.EnumType[] types = values();
for (int i = 0; i < types.length; ++i) {
META_LOOKUP[types[i].getMetadata()] = types[i];
}
}

View file

@ -181,7 +181,7 @@ public class BlockTallGrass extends BlockBush implements IGrowable {
public static enum EnumType implements IStringSerializable {
DEAD_BUSH(0, "dead_bush"), GRASS(1, "tall_grass"), FERN(2, "fern");
private static final BlockTallGrass.EnumType[] META_LOOKUP = new BlockTallGrass.EnumType[values().length];
private static final BlockTallGrass.EnumType[] META_LOOKUP = new BlockTallGrass.EnumType[3];
private final int meta;
private final String name;
@ -211,8 +211,9 @@ public class BlockTallGrass extends BlockBush implements IGrowable {
}
static {
for (BlockTallGrass.EnumType blocktallgrass$enumtype : values()) {
META_LOOKUP[blocktallgrass$enumtype.getMeta()] = blocktallgrass$enumtype;
BlockTallGrass.EnumType[] types = values();
for (int i = 0; i < types.length; ++i) {
META_LOOKUP[types[i].getMeta()] = types[i];
}
}

View file

@ -107,7 +107,9 @@ public class BlockTorch extends Block {
if (this.canPlaceAt(world, blockpos, enumfacing)) {
return this.getDefaultState().withProperty(FACING, enumfacing);
} else {
for (EnumFacing enumfacing1 : EnumFacing.Plane.HORIZONTAL) {
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int i = 0; i < facings.length; ++i) {
EnumFacing enumfacing1 = facings[i];
if (world.isBlockNormalCube(blockpos.offset(enumfacing1.getOpposite()), true)) {
return this.getDefaultState().withProperty(FACING, enumfacing1);
}

View file

@ -206,13 +206,13 @@ public class BlockTripWire extends Block {
IBlockState iblockstate = worldIn.getBlockState(pos);
boolean flag = ((Boolean) iblockstate.getValue(POWERED)).booleanValue();
boolean flag1 = false;
List list = worldIn.getEntitiesWithinAABBExcludingEntity((Entity) null,
List<Entity> list = worldIn.getEntitiesWithinAABBExcludingEntity((Entity) null,
new AxisAlignedBB((double) pos.getX() + this.minX, (double) pos.getY() + this.minY,
(double) pos.getZ() + this.minZ, (double) pos.getX() + this.maxX,
(double) pos.getY() + this.maxY, (double) pos.getZ() + this.maxZ));
if (!list.isEmpty()) {
for (Entity entity : (List<Entity>) list) {
if (!entity.doesEntityNotTriggerPressurePlate()) {
for (int i = 0, l = list.size(); i < l; ++i) {
if (!list.get(i).doesEntityNotTriggerPressurePlate()) {
flag1 = true;
break;
}

View file

@ -91,8 +91,10 @@ public class BlockTripWireHook extends Block {
}
public boolean canPlaceBlockAt(World world, BlockPos blockpos) {
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
if (world.getBlockState(blockpos.offset(enumfacing)).getBlock().isNormalCube()) {
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
BlockPos tmp = new BlockPos(0, 0, 0);
for (int i = 0; i < facings.length; ++i) {
if (world.getBlockState(blockpos.offsetEvenFaster(facings[i], tmp)).getBlock().isNormalCube()) {
return true;
}
}

View file

@ -187,11 +187,14 @@ public class BlockVine extends Block {
private boolean recheckGrownSides(World worldIn, BlockPos pos, IBlockState state) {
IBlockState iblockstate = state;
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
BlockPos tmp = new BlockPos(0, 0, 0);
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int i = 0; i < facings.length; ++i) {
EnumFacing enumfacing = facings[i];
PropertyBool propertybool = getPropertyFor(enumfacing);
if (((Boolean) state.getValue(propertybool)).booleanValue()
&& !this.canPlaceOn(worldIn.getBlockState(pos.offset(enumfacing)).getBlock())) {
IBlockState iblockstate1 = worldIn.getBlockState(pos.up());
&& !this.canPlaceOn(worldIn.getBlockState(pos.offsetEvenFaster(enumfacing, tmp)).getBlock())) {
IBlockState iblockstate1 = worldIn.getBlockState(pos.offsetEvenFaster(EnumFacing.UP, tmp));
if (iblockstate1.getBlock() != this
|| !((Boolean) iblockstate1.getValue(propertybool)).booleanValue()) {
state = state.withProperty(propertybool, Boolean.valueOf(false));
@ -256,13 +259,16 @@ public class BlockVine extends Block {
EnumFacing enumfacing1 = EnumFacing.random(random);
BlockPos blockpos2 = blockpos.up();
BlockPos tmp = new BlockPos(0, 0, 0);
if (enumfacing1 == EnumFacing.UP && blockpos.getY() < 255 && world.isAirBlock(blockpos2)) {
if (!flag) {
IBlockState iblockstate3 = iblockstate;
for (EnumFacing enumfacing3 : EnumFacing.Plane.HORIZONTAL) {
if (random.nextBoolean() || !this
.canPlaceOn(world.getBlockState(blockpos2.offset(enumfacing3)).getBlock())) {
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
for (int j = 0; j < facings.length; ++j) {
EnumFacing enumfacing3 = facings[j];
if (random.nextBoolean() || !this.canPlaceOn(
world.getBlockState(blockpos2.offsetEvenFaster(enumfacing3, tmp)).getBlock())) {
iblockstate3 = iblockstate3.withProperty(getPropertyFor(enumfacing3),
Boolean.valueOf(false));
}
@ -296,12 +302,12 @@ public class BlockVine extends Block {
} else if (flag2 && this.canPlaceOn(world.getBlockState(blockpos1).getBlock())) {
world.setBlockState(blockpos4, this.getDefaultState()
.withProperty(getPropertyFor(enumfacing4), Boolean.valueOf(true)), 2);
} else if (flag1 && world.isAirBlock(blockpos5)
&& this.canPlaceOn(world.getBlockState(blockpos.offset(enumfacing2)).getBlock())) {
} else if (flag1 && world.isAirBlock(blockpos5) && this.canPlaceOn(
world.getBlockState(blockpos.offsetEvenFaster(enumfacing2, tmp)).getBlock())) {
world.setBlockState(blockpos5, this.getDefaultState().withProperty(
getPropertyFor(enumfacing1.getOpposite()), Boolean.valueOf(true)), 2);
} else if (flag2 && world.isAirBlock(blockpos1)
&& this.canPlaceOn(world.getBlockState(blockpos.offset(enumfacing4)).getBlock())) {
} else if (flag2 && world.isAirBlock(blockpos1) && this.canPlaceOn(
world.getBlockState(blockpos.offsetEvenFaster(enumfacing4, tmp)).getBlock())) {
world.setBlockState(blockpos1, this.getDefaultState().withProperty(
getPropertyFor(enumfacing1.getOpposite()), Boolean.valueOf(true)), 2);
} else if (this.canPlaceOn(world.getBlockState(blockpos4.up()).getBlock())) {
@ -318,12 +324,13 @@ public class BlockVine extends Block {
BlockPos blockpos3 = blockpos.down();
IBlockState iblockstate1 = world.getBlockState(blockpos3);
Block block = iblockstate1.getBlock();
EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray;
if (block.blockMaterial == Material.air) {
IBlockState iblockstate2 = iblockstate;
for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) {
for (int j = 0; j < facings.length; ++j) {
if (random.nextBoolean()) {
iblockstate2 = iblockstate2.withProperty(getPropertyFor(enumfacing),
iblockstate2 = iblockstate2.withProperty(getPropertyFor(facings[j]),
Boolean.valueOf(false));
}
}
@ -337,8 +344,8 @@ public class BlockVine extends Block {
} else if (block == this) {
IBlockState iblockstate4 = iblockstate1;
for (EnumFacing enumfacing5 : EnumFacing.Plane.HORIZONTAL) {
PropertyBool propertybool = getPropertyFor(enumfacing5);
for (int j = 0; j < facings.length; ++j) {
PropertyBool propertybool = getPropertyFor(facings[j]);
if (random.nextBoolean()
&& ((Boolean) iblockstate.getValue(propertybool)).booleanValue()) {
iblockstate4 = iblockstate4.withProperty(propertybool, Boolean.valueOf(true));
@ -459,8 +466,8 @@ public class BlockVine extends Block {
public static int getNumGrownFaces(IBlockState state) {
int i = 0;
for (PropertyBool propertybool : ALL_FACES) {
if (((Boolean) state.getValue(propertybool)).booleanValue()) {
for (int j = 0; j < ALL_FACES.length; ++j) {
if (((Boolean) state.getValue(ALL_FACES[j])).booleanValue()) {
++i;
}
}

View file

@ -148,8 +148,9 @@ public class BlockWall extends Block {
* (eg: wood returns 4 blocks)
*/
public void getSubBlocks(Item item, CreativeTabs var2, List<ItemStack> list) {
for (BlockWall.EnumType blockwall$enumtype : BlockWall.EnumType.values()) {
list.add(new ItemStack(item, 1, blockwall$enumtype.getMetadata()));
BlockWall.EnumType[] types = BlockWall.EnumType.META_LOOKUP;
for (int i = 0; i < types.length; ++i) {
list.add(new ItemStack(item, 1, types[i].getMetadata()));
}
}
@ -202,7 +203,7 @@ public class BlockWall extends Block {
public static enum EnumType implements IStringSerializable {
NORMAL(0, "cobblestone", "normal"), MOSSY(1, "mossy_cobblestone", "mossy");
private static final BlockWall.EnumType[] META_LOOKUP = new BlockWall.EnumType[values().length];
public static final BlockWall.EnumType[] META_LOOKUP = new BlockWall.EnumType[2];
private final int meta;
private final String name;
private String unlocalizedName;
@ -238,8 +239,9 @@ public class BlockWall extends Block {
}
static {
for (BlockWall.EnumType blockwall$enumtype : values()) {
META_LOOKUP[blockwall$enumtype.getMetadata()] = blockwall$enumtype;
BlockWall.EnumType[] types = values();
for (int i = 0; i < types.length; ++i) {
META_LOOKUP[types[i].getMetadata()] = types[i];
}
}

View file

@ -93,8 +93,9 @@ public abstract class BlockWoodSlab extends BlockSlab {
*/
public void getSubBlocks(Item item, CreativeTabs var2, List<ItemStack> list) {
if (item != Item.getItemFromBlock(Blocks.double_wooden_slab)) {
for (BlockPlanks.EnumType blockplanks$enumtype : BlockPlanks.EnumType.values()) {
list.add(new ItemStack(item, 1, blockplanks$enumtype.getMetadata()));
BlockPlanks.EnumType[] types = BlockPlanks.EnumType.META_LOOKUP;
for (int i = 0; i < types.length; ++i) {
list.add(new ItemStack(item, 1, types[i].getMetadata()));
}
}

View file

@ -51,7 +51,7 @@ public class PropertyDirection extends PropertyEnum<EnumFacing> {
/**+
* Create a new PropertyDirection with the given name
*/
return create(name, Collections2.filter(Lists.newArrayList(EnumFacing.values()), filter));
return create(name, Collections2.filter(Lists.newArrayList(EnumFacing._VALUES), filter));
}
/**+

View file

@ -185,7 +185,9 @@ public class BlockPistonStructureHelper {
}
private boolean func_177250_b(BlockPos parBlockPos) {
for (EnumFacing enumfacing : EnumFacing.values()) {
EnumFacing[] facings = EnumFacing._VALUES;
for (int i = 0; i < facings.length; ++i) {
EnumFacing enumfacing = facings[i];
if (enumfacing.getAxis() != this.moveDirection.getAxis()
&& !this.func_177251_a(parBlockPos.offset(enumfacing))) {
return false;

View file

@ -92,8 +92,11 @@ public class BlockPattern {
int i = Math.max(Math.max(this.palmLength, this.thumbLength), this.fingerLength);
for (BlockPos blockpos : BlockPos.getAllInBox(pos, pos.add(i - 1, i - 1, i - 1))) {
for (EnumFacing enumfacing : EnumFacing.values()) {
for (EnumFacing enumfacing1 : EnumFacing.values()) {
EnumFacing[] facings = EnumFacing._VALUES;
for (int j = 0; j < facings.length; ++j) {
EnumFacing enumfacing = facings[j];
for (int k = 0; k < facings.length; ++k) {
EnumFacing enumfacing1 = facings[k];
if (enumfacing1 != enumfacing && enumfacing1 != enumfacing.getOpposite()) {
BlockPattern.PatternHelper blockpattern$patternhelper = this.checkPatternAt(blockpos,
enumfacing, enumfacing1, loadingcache);

View file

@ -1,6 +1,5 @@
package net.minecraft.block.state.pattern;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -58,14 +57,17 @@ public class FactoryBlockPattern {
throw new IllegalArgumentException("Expected aisle with height of " + this.aisleHeight
+ ", but was given one with a height of " + aisle.length + ")");
} else {
for (String s : aisle) {
for (int i = 0; i < aisle.length; ++i) {
String s = aisle[i];
if (s.length() != this.rowWidth) {
throw new IllegalArgumentException(
"Not all rows in the given aisle are the correct width (expected " + this.rowWidth
+ ", found one with " + s.length() + ")");
}
for (char c0 : s.toCharArray()) {
char[] achar = s.toCharArray();
for (int j = 0; j < achar.length; ++j) {
char c0 = achar[j];
if (!this.symbolMap.containsKey(Character.valueOf(c0))) {
this.symbolMap.put(Character.valueOf(c0), null);
}

View file

@ -34,6 +34,7 @@ import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformType;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFolderResourcePack;
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFontRenderer;
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
@ -74,7 +75,6 @@ import net.minecraft.client.gui.GuiGameOver;
import net.minecraft.client.gui.GuiIngame;
import net.minecraft.client.gui.GuiIngameMenu;
import net.minecraft.client.gui.GuiMainMenu;
import net.minecraft.client.gui.GuiMemoryErrorScreen;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiSleepMP;
import net.minecraft.client.gui.ScaledResolution;
@ -384,6 +384,7 @@ public class Minecraft implements IThreadListener {
logger.info("EagRuntime Version: " + EagRuntime.getVersion());
this.createDisplay();
this.registerMetadataSerializers();
EaglerFolderResourcePack.deleteOldResourcePacks(EaglerFolderResourcePack.SERVER_RESOURCE_PACKS, 604800000L);
this.mcResourcePackRepository = new ResourcePackRepository(this.mcDefaultResourcePack, this.metadataSerializer_,
this.gameSettings);
this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_);
@ -696,7 +697,7 @@ public class Minecraft implements IThreadListener {
if (SingleplayerServerController.shutdownEaglercraftServer()
|| SingleplayerServerController.getStatusState() == IntegratedServerState.WORLD_UNLOADING) {
displayGuiScreen(new GuiScreenIntegratedServerBusy(cont, "singleplayer.busy.stoppingIntegratedServer",
"singleplayer.failed.stoppingIntegratedServer", () -> SingleplayerServerController.isReady()));
"singleplayer.failed.stoppingIntegratedServer", SingleplayerServerController::isReady));
} else {
displayGuiScreen(cont);
}
@ -1703,8 +1704,7 @@ public class Minecraft implements IThreadListener {
if (SingleplayerServerController.hangupEaglercraftServer()) {
this.displayGuiScreen(new GuiScreenIntegratedServerBusy(currentScreen,
"singleplayer.busy.stoppingIntegratedServer",
"singleplayer.failed.stoppingIntegratedServer",
() -> SingleplayerServerController.isReady()));
"singleplayer.failed.stoppingIntegratedServer", SingleplayerServerController::isReady));
}
}
}

View file

@ -28,6 +28,8 @@ public enum SoundCategory {
MASTER("master", 0), MUSIC("music", 1), RECORDS("record", 2), WEATHER("weather", 3), BLOCKS("block", 4),
MOBS("hostile", 5), ANIMALS("neutral", 6), PLAYERS("player", 7), AMBIENT("ambient", 8), VOICE("voice", 9);
public static final SoundCategory[] _VALUES = values();
private static final Map<String, SoundCategory> NAME_CATEGORY_MAP = Maps.newHashMap();
private static final Map<Integer, SoundCategory> ID_CATEGORY_MAP = Maps.newHashMap();
private final String categoryName;
@ -51,7 +53,9 @@ public enum SoundCategory {
}
static {
for (SoundCategory soundcategory : values()) {
SoundCategory[] categories = _VALUES;
for (int i = 0; i < categories.length; ++i) {
SoundCategory soundcategory = categories[i];
if (NAME_CATEGORY_MAP.containsKey(soundcategory.getCategoryName())
|| ID_CATEGORY_MAP.containsKey(Integer.valueOf(soundcategory.getCategoryId()))) {
throw new Error("Clash in Sound Category ID & Name pools! Cannot insert " + soundcategory);

View file

@ -49,8 +49,8 @@ public class SoundEventAccessorComposite implements ISoundEventAccessor<SoundPoo
public int getWeight() {
int i = 0;
for (ISoundEventAccessor isoundeventaccessor : this.soundPool) {
i += isoundeventaccessor.getWeight();
for (int j = 0, l = this.soundPool.size(); j < l; ++j) {
i += this.soundPool.get(j).getWeight();
}
return i;
@ -61,7 +61,8 @@ public class SoundEventAccessorComposite implements ISoundEventAccessor<SoundPoo
if (!this.soundPool.isEmpty() && i != 0) {
int j = this.rnd.nextInt(i);
for (ISoundEventAccessor isoundeventaccessor : this.soundPool) {
for (int k = 0, l = this.soundPool.size(); k < l; ++k) {
ISoundEventAccessor isoundeventaccessor = this.soundPool.get(k);
j -= isoundeventaccessor.getWeight();
if (j < 0) {
SoundPoolEntry soundpoolentry = (SoundPoolEntry) isoundeventaccessor.cloneEntry();

View file

@ -115,9 +115,10 @@ public class SoundList {
}
public static SoundList.SoundEntry.Type getType(String parString1) {
for (SoundList.SoundEntry.Type soundlist$soundentry$type : values()) {
if (soundlist$soundentry$type.field_148583_c.equals(parString1)) {
return soundlist$soundentry$type;
SoundList.SoundEntry.Type[] types = values();
for (int i = 0; i < types.length; ++i) {
if (types[i].field_148583_c.equals(parString1)) {
return types[i];
}
}

View file

@ -1,8 +1,6 @@
package net.minecraft.client.entity;
import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController;
import net.lax1dude.eaglercraft.v1_8.sp.lan.LANClientNetworkManager;
import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController;
import net.lax1dude.eaglercraft.v1_8.sp.socket.ClientIntegratedServerNetworkManager;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.MovingSoundMinecartRiding;

View file

@ -680,8 +680,9 @@ public class FontRenderer implements IResourceManagerReloadListener {
* wordwrap and with darker drop shadow color if flag is set
*/
private void renderSplitString(String str, int x, int y, int wrapWidth, boolean addShadow) {
for (String s : this.listFormattedStringToWidth(str, wrapWidth)) {
this.renderStringAligned(s, x, y, wrapWidth, this.textColor, addShadow);
List<String> lst = this.listFormattedStringToWidth(str, wrapWidth);
for (int i = 0, l = lst.size(); i < l; ++i) {
this.renderStringAligned(lst.get(i), x, y, wrapWidth, this.textColor, addShadow);
y += this.FONT_HEIGHT;
}

View file

@ -226,15 +226,16 @@ public class GuiChat extends GuiScreen {
this.inputField.deleteFromCursor(i - this.inputField.getCursorPosition());
}
if (this.foundPlayerNames.size() > 1) {
int l = this.foundPlayerNames.size();
if (l > 1) {
StringBuilder stringbuilder = new StringBuilder();
for (String s2 : this.foundPlayerNames) {
for (int i = 0; i < l; ++i) {
if (stringbuilder.length() > 0) {
stringbuilder.append(", ");
}
stringbuilder.append(s2);
stringbuilder.append(this.foundPlayerNames.get(i));
}
this.mc.ingameGUI.getChatGUI()
@ -306,7 +307,8 @@ public class GuiChat extends GuiScreen {
this.playerNamesFound = false;
this.foundPlayerNames.clear();
for (String s : parArrayOfString) {
for (int i = 0; i < parArrayOfString.length; ++i) {
String s = parArrayOfString[i];
if (s.length() > 0) {
this.foundPlayerNames.add(s);
}

View file

@ -91,8 +91,9 @@ public class GuiControls extends GuiScreen {
if (parGuiButton.id == 200) {
this.mc.displayGuiScreen(this.parentScreen);
} else if (parGuiButton.id == 201) {
for (KeyBinding keybinding : this.mc.gameSettings.keyBindings) {
keybinding.setKeyCode(keybinding.getKeyCodeDefault());
KeyBinding[] arr = this.mc.gameSettings.keyBindings;
for (int i = 0; i < arr.length; ++i) {
arr[i].setKeyCode(arr[i].getKeyCodeDefault());
}
KeyBinding.resetKeyBindingArrayAndHash();
@ -165,8 +166,9 @@ public class GuiControls extends GuiScreen {
this.drawCenteredString(this.fontRendererObj, this.screenTitle, this.width / 2, 8, 16777215);
boolean flag = true;
for (KeyBinding keybinding : this.options.keyBindings) {
if (keybinding.getKeyCode() != keybinding.getKeyCodeDefault()) {
KeyBinding[] arr = this.options.keyBindings;
for (int k = 0; k < arr.length; ++k) {
if (arr[k].getKeyCode() != arr[k].getKeyCodeDefault()) {
flag = false;
break;
}

View file

@ -6,12 +6,6 @@ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiCreateWorld;
import net.minecraft.client.gui.GuiFlatPresets;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiSlot;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;

View file

@ -1,14 +1,8 @@
package net.minecraft.client.gui;
import java.io.IOException;
import java.util.Random;
import net.lax1dude.eaglercraft.v1_8.Keyboard;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiCreateFlatWorld;
import net.minecraft.client.gui.GuiCustomizeWorldScreen;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.ChatAllowedCharacters;
import net.minecraft.world.WorldSettings;
@ -130,8 +124,8 @@ public class GuiCreateWorld extends GuiScreen {
private void func_146314_g() {
this.field_146336_i = this.field_146333_g.getText().trim();
for (char c0 : ChatAllowedCharacters.allowedCharactersArray) {
this.field_146336_i = this.field_146336_i.replace(c0, '_');
for (int i = 0; i < ChatAllowedCharacters.allowedCharactersArray.length; ++i) {
this.field_146336_i = this.field_146336_i.replace(ChatAllowedCharacters.allowedCharactersArray[i], '_');
}
if (StringUtils.isEmpty(this.field_146336_i)) {
@ -180,8 +174,8 @@ public class GuiCreateWorld extends GuiScreen {
public static String func_146317_a(ISaveFormat parISaveFormat, String parString1) {
parString1 = parString1.replaceAll("[\\./\"]", "_");
for (String s : disallowedFilenames) {
if (parString1.equalsIgnoreCase(s)) {
for (int i = 0; i < disallowedFilenames.length; ++i) {
if (parString1.equalsIgnoreCase(disallowedFilenames[i])) {
parString1 = "_" + parString1 + "_";
}
}

View file

@ -40,7 +40,9 @@ public class GuiCustomizeSkin extends GuiScreen {
int i = 0;
this.title = I18n.format("options.skinCustomisation.title", new Object[0]);
for (EnumPlayerModelParts enumplayermodelparts : EnumPlayerModelParts.values()) {
EnumPlayerModelParts[] parts = EnumPlayerModelParts._VALUES;
for (int k = 0; k < parts.length; ++k) {
EnumPlayerModelParts enumplayermodelparts = parts[k];
this.buttonList.add(new GuiCustomizeSkin.ButtonPart(enumplayermodelparts.getPartId(),
this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), 150, 20,
enumplayermodelparts));

View file

@ -8,15 +8,6 @@ import java.util.Random;
import net.lax1dude.eaglercraft.v1_8.HString;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiCreateWorld;
import net.minecraft.client.gui.GuiListButton;
import net.minecraft.client.gui.GuiPageButtonList;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiScreenCustomizePresets;
import net.minecraft.client.gui.GuiSlider;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.resources.I18n;

View file

@ -87,8 +87,9 @@ public class GuiDisconnected extends GuiScreen {
this.height / 2 - this.field_175353_i / 2 - this.fontRendererObj.FONT_HEIGHT * 2, 11184810);
int k = this.height / 2 - this.field_175353_i / 2;
if (this.multilineMessage != null) {
for (String s : this.multilineMessage) {
this.drawCenteredString(this.fontRendererObj, s, this.width / 2, k, 16777215);
for (int l = 0, m = this.multilineMessage.size(); l < m; ++l) {
this.drawCenteredString(this.fontRendererObj, this.multilineMessage.get(l), this.width / 2, k,
16777215);
k += this.fontRendererObj.FONT_HEIGHT;
}
}

View file

@ -10,12 +10,6 @@ import net.lax1dude.eaglercraft.v1_8.Keyboard;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
import net.minecraft.block.BlockTallGrass;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiCreateFlatWorld;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiSlot;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
@ -189,8 +183,8 @@ public class GuiFlatPresets extends GuiScreen {
flatgeneratorinfo.setBiome(parBiomeGenBase.biomeID);
flatgeneratorinfo.func_82645_d();
if (parList != null) {
for (String s : parList) {
flatgeneratorinfo.getWorldFeatures().put(s, Maps.newHashMap());
for (int i = 0, l = parList.size(); i < l; ++i) {
flatgeneratorinfo.getWorldFeatures().put(parList.get(i), Maps.newHashMap());
}
}

View file

@ -54,8 +54,8 @@ public class GuiGameOver extends GuiScreen implements GuiYesNoCallback {
}
}
for (GuiButton guibutton : this.buttonList) {
guibutton.enabled = false;
for (int i = 0, l = this.buttonList.size(); i < l; ++i) {
this.buttonList.get(i).enabled = false;
}
}
@ -150,8 +150,8 @@ public class GuiGameOver extends GuiScreen implements GuiYesNoCallback {
super.updateScreen();
++this.enableButtonsTimer;
if (this.enableButtonsTimer == 20) {
for (GuiButton guibutton : this.buttonList) {
guibutton.enabled = true;
for (int i = 0, l = this.buttonList.size(); i < l; ++i) {
this.buttonList.get(i).enabled = true;
}
}

View file

@ -4,7 +4,6 @@ import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
@ -487,7 +486,8 @@ public class GuiIngame extends Gui {
int i = this.getFontRenderer().getStringWidth(parScoreObjective.getDisplayName());
for (Score score : (List<Score>) arraylist1) {
for (int m = 0, n = arraylist1.size(); m < n; ++m) {
Score score = (Score) arraylist1.get(m);
ScorePlayerTeam scoreplayerteam = scoreboard.getPlayersTeam(score.getPlayerName());
String s = ScorePlayerTeam.formatPlayerName(scoreplayerteam, score.getPlayerName()) + ": "
+ EnumChatFormatting.RED + score.getScorePoints();
@ -500,7 +500,8 @@ public class GuiIngame extends Gui {
int k1 = parScaledResolution.getScaledWidth() - i - b0;
int j = 0;
for (Score score1 : (List<Score>) arraylist1) {
for (int m = 0, n = arraylist1.size(); m < n; ++m) {
Score score1 = (Score) arraylist1.get(m);
++j;
ScorePlayerTeam scoreplayerteam1 = scoreboard.getPlayersTeam(score1.getPlayerName());
String s1 = ScorePlayerTeam.formatPlayerName(scoreplayerteam1, score1.getPlayerName());

View file

@ -45,7 +45,8 @@ public class GuiKeyBindingList extends GuiListExtended {
int i = 0;
String s = null;
for (KeyBinding keybinding : akeybinding) {
for (int l = 0; l < akeybinding.length; ++l) {
KeyBinding keybinding = akeybinding[l];
String s1 = keybinding.getKeyCategory();
if (!s1.equals(s)) {
s = s1;
@ -138,7 +139,9 @@ public class GuiKeyBindingList extends GuiListExtended {
this.btnChangeKeyBinding.displayString = GameSettings.getKeyDisplayString(this.keybinding.getKeyCode());
boolean flag1 = false;
if (this.keybinding.getKeyCode() != 0) {
for (KeyBinding keybindingx : GuiKeyBindingList.this.mc.gameSettings.keyBindings) {
KeyBinding[] kb = GuiKeyBindingList.this.mc.gameSettings.keyBindings;
for (int m = 0; m < kb.length; ++m) {
KeyBinding keybindingx = kb[m];
if (keybindingx != this.keybinding && keybindingx.getKeyCode() == this.keybinding.getKeyCode()) {
flag1 = true;
break;

View file

@ -44,7 +44,6 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.demo.DemoWorldServer;
import net.minecraft.world.storage.ISaveFormat;
/**+
@ -358,7 +357,7 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback {
ISaveFormat isaveformat = this.mc.getSaveLoader();
isaveformat.deleteWorldDirectory("Demo World");
this.mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(this, "singleplayer.busy.deleting",
"singleplayer.failed.deleting", () -> SingleplayerServerController.isReady()));
"singleplayer.failed.deleting", SingleplayerServerController::isReady));
} else {
this.mc.displayGuiScreen(this);
}

View file

@ -264,6 +264,10 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback {
}
}
public void cancelDirectConnect() {
this.directConnect = false;
}
/**+
* Fired when a key is typed (except F11 which toggles full
* screen). This is the equivalent of
@ -329,11 +333,11 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback {
this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.title", new Object[0]), this.width / 2,
20, 16777215);
super.drawScreen(i, j, f);
relaysButton.drawScreen(i, j);
drawPluginDownloadLink(i, j);
if (this.hoveringText != null) {
this.drawHoveringText(Lists.newArrayList(Splitter.on("\n").split(this.hoveringText)), i, j);
}
relaysButton.drawScreen(i, j);
drawPluginDownloadLink(i, j);
}
private void drawPluginDownloadLink(int xx, int yy) {

View file

@ -154,13 +154,13 @@ public class GuiNewChat extends Gui {
List list = GuiUtilRenderComponents.func_178908_a(parIChatComponent, i, this.mc.fontRendererObj, false, false);
boolean flag = this.getChatOpen();
for (IChatComponent ichatcomponent : (List<IChatComponent>) list) {
for (int j = 0, l = list.size(); j < l; ++j) {
if (flag && this.scrollPos > 0) {
this.isScrolled = true;
this.scroll(1);
}
this.field_146253_i.add(0, new ChatLine(parInt2, ichatcomponent, parInt1));
this.field_146253_i.add(0, new ChatLine(parInt2, (IChatComponent) list.get(j), parInt1));
}
while (this.field_146253_i.size() > 100) {

View file

@ -1,16 +1,23 @@
package net.minecraft.client.gui;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.Mouse;
import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType;
import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformType;
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFolderResourcePack;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.EaglerDeferredPipeline;
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.gui.GuiShaderConfig;
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.gui.GuiShadersNotSupported;
import net.lax1dude.eaglercraft.v1_8.profile.GuiScreenImportExportProfile;
import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController;
import net.lax1dude.eaglercraft.v1_8.vfs.SYS;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.EnumDifficulty;
/**+
@ -57,7 +64,8 @@ public class GuiOptions extends GuiScreen implements GuiYesNoCallback {
int i = 0;
this.field_146442_a = I18n.format("options.title", new Object[0]);
for (GameSettings.Options gamesettings$options : field_146440_f) {
for (int j = 0; j < field_146440_f.length; ++j) {
GameSettings.Options gamesettings$options = field_146440_f[j];
if (gamesettings$options.getEnumFloat()) {
this.buttonList.add(new GuiOptionSlider(gamesettings$options.returnEnumOrdinal(),
this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1),
@ -108,17 +116,15 @@ public class GuiOptions extends GuiScreen implements GuiYesNoCallback {
I18n.format("options.language", new Object[0])));
this.buttonList.add(new GuiButton(103, this.width / 2 + 5, this.height / 6 + 120 - 6, 150, 20,
I18n.format("options.chat.title", new Object[0])));
GuiButton rp;
this.buttonList.add(rp = new GuiButton(105, this.width / 2 - 155, this.height / 6 + 144 - 6, 150, 20,
GuiButton btn;
this.buttonList.add(btn = new GuiButton(105, this.width / 2 - 155, this.height / 6 + 144 - 6, 150, 20,
I18n.format("options.resourcepack", new Object[0])));
GuiButton dbg;
this.buttonList.add(dbg = new GuiButton(104, this.width / 2 + 5, this.height / 6 + 144 - 6, 150, 20,
btn.enabled = EaglerFolderResourcePack.isSupported();
this.buttonList.add(btn = new GuiButton(104, this.width / 2 + 5, this.height / 6 + 144 - 6, 150, 20,
I18n.format("options.debugConsoleButton", new Object[0])));
dbg.enabled = EagRuntime.getPlatformType() != EnumPlatformType.DESKTOP;
btn.enabled = EagRuntime.getPlatformType() != EnumPlatformType.DESKTOP;
this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168,
I18n.format("gui.done", new Object[0])));
rp.enabled = SYS.VFS != null;
}
public String func_175355_a(EnumDifficulty parEnumDifficulty) {
@ -241,6 +247,36 @@ public class GuiOptions extends GuiScreen implements GuiYesNoCallback {
public void drawScreen(int i, int j, float f) {
this.drawDefaultBackground();
this.drawCenteredString(this.fontRendererObj, this.field_146442_a, this.width / 2, 15, 16777215);
if (mc.theWorld == null && !EagRuntime.getConfiguration().isDemo()) {
GlStateManager.pushMatrix();
GlStateManager.scale(0.75f, 0.75f, 0.75f);
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
String text = I18n.format("editProfile.importExport");
int w = mc.fontRendererObj.getStringWidth(text);
boolean hover = i > 1 && j > 1 && i < (w * 3 / 4) + 7 && j < 12;
if (hover) {
Mouse.showCursor(EnumCursorType.HAND);
}
drawString(mc.fontRendererObj, EnumChatFormatting.UNDERLINE + text, 5, 5, hover ? 0xFFEEEE22 : 0xFFCCCCCC);
GlStateManager.popMatrix();
}
super.drawScreen(i, j, f);
}
protected void mouseClicked(int mx, int my, int button) {
super.mouseClicked(mx, my, button);
if (mc.theWorld == null && !EagRuntime.getConfiguration().isDemo()) {
int w = mc.fontRendererObj.getStringWidth(I18n.format("editProfile.importExport"));
if (mx > 1 && my > 1 && mx < (w * 3 / 4) + 7 && my < 12) {
mc.displayGuiScreen(new GuiScreenImportExportProfile(this));
mc.getSoundHandler()
.playSound(PositionedSoundRecord.create(new ResourceLocation("gui.button.press"), 1.0F));
}
}
}
}

View file

@ -20,18 +20,14 @@ import net.lax1dude.eaglercraft.v1_8.HString;
import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformType;
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper;
import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController;
import net.minecraft.block.Block;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.ClientBrandRetriever;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumChatFormatting;
@ -284,7 +280,8 @@ public class GuiOverlayDebug extends Gui {
List<String> strs = SingleplayerServerController.getTPS();
int l;
boolean first = true;
for (String str : strs) {
for (int j = 0, m = strs.size(); j < m; ++j) {
String str = strs.get(j);
l = (int) (this.fontRenderer.getStringWidth(str) * (!first ? 0.5f : 1.0f));
GlStateManager.pushMatrix();
GlStateManager.translate(parScaledResolution.getScaledWidth() - 2 - l, i + 2, 0.0f);

View file

@ -50,7 +50,8 @@ public class GuiPageButtonList extends GuiListExtended {
}
private void func_178069_s() {
for (GuiPageButtonList.GuiListEntry[] aguipagebuttonlist$guilistentry : this.field_178078_x) {
for (int n = 0; n < this.field_178078_x.length; ++n) {
GuiPageButtonList.GuiListEntry[] aguipagebuttonlist$guilistentry = this.field_178078_x[n];
for (int i = 0; i < aguipagebuttonlist$guilistentry.length; i += 2) {
GuiPageButtonList.GuiListEntry guipagebuttonlist$guilistentry = aguipagebuttonlist$guilistentry[i];
GuiPageButtonList.GuiListEntry guipagebuttonlist$guilistentry1 = i < aguipagebuttonlist$guilistentry.length
@ -137,17 +138,18 @@ public class GuiPageButtonList extends GuiListExtended {
}
private void func_178060_e(int parInt1, int parInt2) {
for (GuiPageButtonList.GuiListEntry guipagebuttonlist$guilistentry : this.field_178078_x[parInt1]) {
if (guipagebuttonlist$guilistentry != null) {
this.func_178066_a((Gui) this.field_178073_v.lookup(guipagebuttonlist$guilistentry.func_178935_b()),
false);
GuiListEntry[] etr = this.field_178078_x[parInt1];
for (int i = 0; i < etr.length; ++i) {
if (etr[i] != null) {
this.func_178066_a((Gui) this.field_178073_v.lookup(etr[i].func_178935_b()), false);
}
}
for (GuiPageButtonList.GuiListEntry guipagebuttonlist$guilistentry1 : this.field_178078_x[parInt2]) {
if (guipagebuttonlist$guilistentry1 != null) {
this.func_178066_a((Gui) this.field_178073_v.lookup(guipagebuttonlist$guilistentry1.func_178935_b()),
true);
etr = this.field_178078_x[parInt2];
for (int i = 0; i < etr.length; ++i) {
if (etr[i] != null) {
this.func_178066_a((Gui) this.field_178073_v.lookup(etr[i].func_178935_b()), true);
}
}
@ -181,7 +183,8 @@ public class GuiPageButtonList extends GuiListExtended {
}
public void func_181155_a(boolean parFlag) {
for (GuiPageButtonList.GuiEntry guipagebuttonlist$guientry : this.field_178074_u) {
for (int i = 0, l = this.field_178074_u.size(); i < l; ++i) {
GuiPageButtonList.GuiEntry guipagebuttonlist$guientry = this.field_178074_u.get(i);
if (guipagebuttonlist$guientry.field_178029_b instanceof GuiButton) {
((GuiButton) guipagebuttonlist$guientry.field_178029_b).enabled = parFlag;
}
@ -290,8 +293,8 @@ public class GuiPageButtonList extends GuiListExtended {
int i = this.field_178072_w.indexOf(this.field_178075_A);
int j = i;
for (String s1 : astring) {
((GuiTextField) this.field_178072_w.get(j)).setText(s1);
for (int k = 0; k < astring.length; ++k) {
((GuiTextField) this.field_178072_w.get(j)).setText(astring[k]);
if (j == this.field_178072_w.size() - 1) {
j = 0;
} else {

View file

@ -90,7 +90,8 @@ public class GuiPlayerTabOverlay extends Gui {
int i = 0;
int j = 0;
for (NetworkPlayerInfo networkplayerinfo : (List<NetworkPlayerInfo>) list) {
for (int m = 0, n = list.size(); m < n; ++m) {
NetworkPlayerInfo networkplayerinfo = (NetworkPlayerInfo) list.get(m);
int k = this.mc.fontRendererObj.getStringWidth(this.getPlayerName(networkplayerinfo));
i = Math.max(i, k);
if (scoreObjectiveIn != null
@ -127,21 +128,21 @@ public class GuiPlayerTabOverlay extends Gui {
int j1 = width / 2 - (i1 * j4 + (j4 - 1) * 5) / 2;
int k1 = 10;
int l1 = i1 * j4 + (j4 - 1) * 5;
List list1 = null;
List list2 = null;
List<String> list1 = null;
List<String> list2 = null;
if (this.header != null) {
list1 = this.mc.fontRendererObj.listFormattedStringToWidth(this.header.getFormattedText(), width - 50);
for (String s : (List<String>) list1) {
l1 = Math.max(l1, this.mc.fontRendererObj.getStringWidth(s));
for (int m = 0, n = list1.size(); m < n; ++m) {
l1 = Math.max(l1, this.mc.fontRendererObj.getStringWidth(list1.get(m)));
}
}
if (this.footer != null) {
list2 = this.mc.fontRendererObj.listFormattedStringToWidth(this.footer.getFormattedText(), width - 50);
for (String s2 : (List<String>) list2) {
l1 = Math.max(l1, this.mc.fontRendererObj.getStringWidth(s2));
for (int m = 0, n = list2.size(); m < n; ++m) {
l1 = Math.max(l1, this.mc.fontRendererObj.getStringWidth(list2.get(m)));
}
}
@ -149,7 +150,8 @@ public class GuiPlayerTabOverlay extends Gui {
drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1,
k1 + list1.size() * this.mc.fontRendererObj.FONT_HEIGHT, Integer.MIN_VALUE);
for (String s3 : (List<String>) list1) {
for (int m = 0, n = list1.size(); m < n; ++m) {
String s3 = list1.get(m);
int i2 = this.mc.fontRendererObj.getStringWidth(s3);
this.mc.fontRendererObj.drawStringWithShadow(s3, (float) (width / 2 - i2 / 2), (float) k1, -1);
k1 += this.mc.fontRendererObj.FONT_HEIGHT;
@ -216,7 +218,8 @@ public class GuiPlayerTabOverlay extends Gui {
drawRect(width / 2 - l1 / 2 - 1, k1 - 1, width / 2 + l1 / 2 + 1,
k1 + list2.size() * this.mc.fontRendererObj.FONT_HEIGHT, Integer.MIN_VALUE);
for (String s4 : (List<String>) list2) {
for (int m = 0, n = list2.size(); m < n; ++m) {
String s4 = list2.get(m);
int j5 = this.mc.fontRendererObj.getStringWidth(s4);
this.mc.fontRendererObj.drawStringWithShadow(s4, (float) (width / 2 - j5 / 2), (float) k1, -1);
k1 += this.mc.fontRendererObj.FONT_HEIGHT;

View file

@ -1,13 +1,8 @@
package net.minecraft.client.gui;
import java.io.IOException;
import net.lax1dude.eaglercraft.v1_8.Keyboard;
import net.lax1dude.eaglercraft.v1_8.sp.SingleplayerServerController;
import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenIntegratedServerBusy;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.resources.I18n;
import net.minecraft.world.storage.ISaveFormat;
import net.minecraft.world.storage.WorldInfo;
@ -101,13 +96,13 @@ public class GuiRenameWorld extends GuiScreen {
SingleplayerServerController.duplicateWorld(this.saveName, this.field_146583_f.getText().trim());
this.mc.displayGuiScreen(
new GuiScreenIntegratedServerBusy(this.parentScreen, "singleplayer.busy.duplicating",
"singleplayer.failed.duplicating", () -> SingleplayerServerController.isReady()));
"singleplayer.failed.duplicating", SingleplayerServerController::isReady));
} else {
ISaveFormat isaveformat = this.mc.getSaveLoader();
isaveformat.renameWorld(this.saveName, this.field_146583_f.getText().trim());
this.mc.displayGuiScreen(
new GuiScreenIntegratedServerBusy(this.parentScreen, "singleplayer.busy.renaming",
"singleplayer.failed.renaming", () -> SingleplayerServerController.isReady()));
"singleplayer.failed.renaming", SingleplayerServerController::isReady));
}
}
}

View file

@ -92,11 +92,11 @@ public abstract class GuiScreen extends Gui implements GuiYesNoCallback {
* mouseY, renderPartialTicks
*/
public void drawScreen(int i, int j, float var3) {
for (int k = 0; k < this.buttonList.size(); ++k) {
for (int k = 0, l = this.buttonList.size(); k < l; ++k) {
((GuiButton) this.buttonList.get(k)).drawButton(this.mc, i, j);
}
for (int l = 0; l < this.labelList.size(); ++l) {
for (int l = 0, m = this.labelList.size(); l < m; ++l) {
((GuiLabel) this.labelList.get(l)).drawLabel(this.mc, i, j);
}
@ -178,7 +178,7 @@ public abstract class GuiScreen extends Gui implements GuiYesNoCallback {
protected void renderToolTip(ItemStack itemstack, int i, int j) {
List list = itemstack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips);
for (int k = 0; k < list.size(); ++k) {
for (int k = 0, l = list.size(); k < l; ++k) {
if (k == 0) {
list.set(k, itemstack.getRarity().rarityColor + (String) list.get(k));
} else {
@ -210,8 +210,8 @@ public abstract class GuiScreen extends Gui implements GuiYesNoCallback {
GlStateManager.disableDepth();
int k = 0;
for (String s : list) {
int l = this.fontRendererObj.getStringWidth(s);
for (int m = 0, n = list.size(); m < n; ++m) {
int l = this.fontRendererObj.getStringWidth(list.get(m));
if (l > k) {
k = l;
}

View file

@ -102,8 +102,8 @@ public class GuiScreenAddServer extends GuiScreen {
+ I18n.format(this.serverData.hideAddress ? "gui.yes" : "gui.no", new Object[0]);
} else if (parGuiButton.id == 2) {
this.serverData.setResourceMode(
ServerData.ServerResourceMode.values()[(this.serverData.getResourceMode().ordinal() + 1)
% ServerData.ServerResourceMode.values().length]);
ServerData.ServerResourceMode._VALUES[(this.serverData.getResourceMode().ordinal() + 1)
% ServerData.ServerResourceMode._VALUES.length]);
this.serverResourcePacks.displayString = I18n.format("addServer.resourcePack", new Object[0]) + ": "
+ this.serverData.getResourceMode().getMotd().getFormattedText();
} else if (parGuiButton.id == 1) {

View file

@ -7,11 +7,6 @@ import java.util.List;
import net.lax1dude.eaglercraft.v1_8.Keyboard;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiCustomizeWorldScreen;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiSlot;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.resources.I18n;

View file

@ -54,7 +54,9 @@ public class GuiScreenOptionsSounds extends GuiScreen {
this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), SoundCategory.MASTER, true));
i = i + 2;
for (SoundCategory soundcategory : SoundCategory.values()) {
SoundCategory[] cats = SoundCategory._VALUES;
for (int j = 0; j < cats.length; ++j) {
SoundCategory soundcategory = cats[j];
if (soundcategory != SoundCategory.MASTER) {
this.buttonList.add(new GuiScreenOptionsSounds.Button(soundcategory.getCategoryId(),
this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), soundcategory,

View file

@ -1,6 +1,5 @@
package net.minecraft.client.gui;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
@ -9,10 +8,11 @@ import java.util.List;
import com.google.common.collect.Lists;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.vfs.SYS;
import net.lax1dude.eaglercraft.v1_8.internal.FileChooserResult;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFolderResourcePack;
import net.lax1dude.eaglercraft.v1_8.minecraft.GuiScreenGenericErrorMessage;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.resources.ResourcePackListEntry;
import net.minecraft.client.resources.ResourcePackListEntryDefault;
@ -58,10 +58,8 @@ public class GuiScreenResourcePacks extends GuiScreen {
* window resizes, the buttonList is cleared beforehand.
*/
public void initGui() {
GuiButton btn;
this.buttonList.add(btn = new GuiOptionButton(2, this.width / 2 - 154, this.height - 48,
this.buttonList.add(new GuiOptionButton(2, this.width / 2 - 154, this.height - 48,
I18n.format("resourcePack.openFolder", new Object[0])));
btn.enabled = SYS.VFS != null;
this.buttonList.add(
new GuiOptionButton(1, this.width / 2 + 4, this.height - 48, I18n.format("gui.done", new Object[0])));
if (!this.changed) {
@ -69,16 +67,18 @@ public class GuiScreenResourcePacks extends GuiScreen {
this.selectedResourcePacks = Lists.newArrayList();
ResourcePackRepository resourcepackrepository = this.mc.getResourcePackRepository();
resourcepackrepository.updateRepositoryEntriesAll();
ArrayList arraylist = Lists.newArrayList(resourcepackrepository.getRepositoryEntriesAll());
List arraylist = Lists.newArrayList(resourcepackrepository.getRepositoryEntriesAll());
arraylist.removeAll(resourcepackrepository.getRepositoryEntries());
for (ResourcePackRepository.Entry resourcepackrepository$entry : (List<ResourcePackRepository.Entry>) arraylist) {
this.availableResourcePacks.add(new ResourcePackListEntryFound(this, resourcepackrepository$entry));
for (int i = 0, l = arraylist.size(); i < l; ++i) {
this.availableResourcePacks
.add(new ResourcePackListEntryFound(this, (ResourcePackRepository.Entry) arraylist.get(i)));
}
for (ResourcePackRepository.Entry resourcepackrepository$entry1 : Lists
.reverse(resourcepackrepository.getRepositoryEntries())) {
this.selectedResourcePacks.add(new ResourcePackListEntryFound(this, resourcepackrepository$entry1));
arraylist = Lists.reverse(resourcepackrepository.getRepositoryEntries());
for (int i = 0, l = arraylist.size(); i < l; ++i) {
this.selectedResourcePacks
.add(new ResourcePackListEntryFound(this, (ResourcePackRepository.Entry) arraylist.get(i)));
}
this.selectedResourcePacks.add(new ResourcePackListEntryDefault(this));
@ -138,14 +138,13 @@ public class GuiScreenResourcePacks extends GuiScreen {
protected void actionPerformed(GuiButton parGuiButton) {
if (parGuiButton.enabled) {
if (parGuiButton.id == 2) {
if (SYS.VFS == null)
return;
EagRuntime.displayFileChooser("application/zip", "zip");
} else if (parGuiButton.id == 1) {
if (this.changed) {
ArrayList arraylist = Lists.newArrayList();
ArrayList<ResourcePackRepository.Entry> arraylist = Lists.newArrayList();
for (ResourcePackListEntry resourcepacklistentry : this.selectedResourcePacks) {
for (int i = 0, l = this.selectedResourcePacks.size(); i < l; ++i) {
ResourcePackListEntry resourcepacklistentry = this.selectedResourcePacks.get(i);
if (resourcepacklistentry instanceof ResourcePackListEntryFound) {
arraylist.add(((ResourcePackListEntryFound) resourcepacklistentry).func_148318_i());
}
@ -156,7 +155,8 @@ public class GuiScreenResourcePacks extends GuiScreen {
this.mc.gameSettings.resourcePacks.clear();
this.mc.gameSettings.field_183018_l.clear();
for (ResourcePackRepository.Entry resourcepackrepository$entry : (List<ResourcePackRepository.Entry>) arraylist) {
for (int i = 0, l = arraylist.size(); i < l; ++i) {
ResourcePackRepository.Entry resourcepackrepository$entry = arraylist.get(i);
this.mc.gameSettings.resourcePacks.add(resourcepackrepository$entry.getResourcePackName());
if (resourcepackrepository$entry.func_183027_f() != 1) {
this.mc.gameSettings.field_183018_l.add(resourcepackrepository$entry.getResourcePackName());
@ -179,15 +179,25 @@ public class GuiScreenResourcePacks extends GuiScreen {
if (EagRuntime.fileChooserHasResult()) {
packFile = EagRuntime.getFileChooserResult();
}
if (packFile == null)
if (packFile == null) {
return;
logger.info("Loading resource pack: {}", packFile.fileName);
}
mc.loadingScreen.eaglerShow(I18n.format("resourcePack.load.loading"), packFile.fileName);
SYS.loadResourcePack(packFile.fileName, new ByteArrayInputStream(packFile.fileData), null);
try {
EaglerFolderResourcePack.importResourcePack(packFile.fileName, EaglerFolderResourcePack.RESOURCE_PACKS,
packFile.fileData);
} catch (IOException e) {
logger.error("Could not load resource pack: {}", packFile.fileName);
logger.error(e);
mc.displayGuiScreen(new GuiScreenGenericErrorMessage("resourcePack.importFailed.1",
"resourcePack.importFailed.2", parentScreen));
return;
}
ArrayList arraylist = Lists.newArrayList();
ArrayList<ResourcePackRepository.Entry> arraylist = Lists.newArrayList();
for (ResourcePackListEntry resourcepacklistentry : this.selectedResourcePacks) {
for (int i = 0, l = this.selectedResourcePacks.size(); i < l; ++i) {
ResourcePackListEntry resourcepacklistentry = this.selectedResourcePacks.get(i);
if (resourcepacklistentry instanceof ResourcePackListEntryFound) {
arraylist.add(((ResourcePackListEntryFound) resourcepacklistentry).func_148318_i());
}
@ -198,7 +208,8 @@ public class GuiScreenResourcePacks extends GuiScreen {
this.mc.gameSettings.resourcePacks.clear();
this.mc.gameSettings.field_183018_l.clear();
for (ResourcePackRepository.Entry resourcepackrepository$entry : (List<ResourcePackRepository.Entry>) arraylist) {
for (int i = 0, l = arraylist.size(); i < l; ++i) {
ResourcePackRepository.Entry resourcepackrepository$entry = arraylist.get(i);
this.mc.gameSettings.resourcePacks.add(resourcepackrepository$entry.getResourcePackName());
if (resourcepackrepository$entry.func_183027_f() != 1) {
this.mc.gameSettings.field_183018_l.add(resourcepackrepository$entry.getResourcePackName());

View file

@ -13,14 +13,6 @@ import net.lax1dude.eaglercraft.v1_8.sp.gui.GuiScreenLANNotSupported;
import net.lax1dude.eaglercraft.v1_8.sp.lan.LANServerController;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiCreateWorld;
import net.minecraft.client.gui.GuiErrorScreen;
import net.minecraft.client.gui.GuiRenameWorld;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiSlot;
import net.minecraft.client.gui.GuiYesNo;
import net.minecraft.client.gui.GuiYesNoCallback;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
@ -110,7 +102,7 @@ public class GuiSelectWorld extends GuiScreen implements GuiYesNoCallback {
waitingForWorlds = true;
this.mc.getSaveLoader().flushCache();
this.mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(this, "singleplayer.busy.listingworlds",
"singleplayer.failed.listingworlds", () -> SingleplayerServerController.isReady(), (t, u) -> {
"singleplayer.failed.listingworlds", SingleplayerServerController::isReady, (t, u) -> {
GuiScreenIntegratedServerBusy tt = (GuiScreenIntegratedServerBusy) t;
Minecraft.getMinecraft().displayGuiScreen(
GuiScreenIntegratedServerBusy.createException(parentScreen, tt.failMessage, u));
@ -232,7 +224,7 @@ public class GuiSelectWorld extends GuiScreen implements GuiYesNoCallback {
ISaveFormat isaveformat = this.mc.getSaveLoader();
isaveformat.deleteWorldDirectory(this.func_146621_a(i));
this.mc.displayGuiScreen(new GuiScreenIntegratedServerBusy(this, "singleplayer.busy.deleting",
"singleplayer.failed.deleting", () -> SingleplayerServerController.isReady()));
"singleplayer.failed.deleting", SingleplayerServerController::isReady));
} else {
this.mc.displayGuiScreen(this);
}

View file

@ -58,17 +58,8 @@ public class GuiVideoSettings extends GuiScreen {
this.buttonList.clear();
this.buttonList.add(
new GuiButton(200, this.width / 2 - 100, this.height - 27, I18n.format("gui.done", new Object[0])));
GameSettings.Options[] agamesettings$options = new GameSettings.Options[videoOptions.length];
int i = 0;
for (GameSettings.Options gamesettings$options : videoOptions) {
agamesettings$options[i] = gamesettings$options;
++i;
}
this.optionsRowList = new GuiOptionsRowList(this.mc, this.width, this.height, 32, this.height - 32, 25,
agamesettings$options);
videoOptions);
}
/**+

View file

@ -90,8 +90,8 @@ public class GuiYesNo extends GuiScreen {
this.drawCenteredString(this.fontRendererObj, this.messageLine1, this.width / 2, 70, 16777215);
int k = 90;
for (String s : this.field_175298_s) {
this.drawCenteredString(this.fontRendererObj, s, this.width / 2, k, 16777215);
for (int l = 0, m = this.field_175298_s.size(); l < m; ++l) {
this.drawCenteredString(this.fontRendererObj, this.field_175298_s.get(l), this.width / 2, k, 16777215);
k += this.fontRendererObj.FONT_HEIGHT;
}
@ -104,8 +104,8 @@ public class GuiYesNo extends GuiScreen {
public void setButtonDelay(int parInt1) {
this.ticksUntilEnable = parInt1;
for (GuiButton guibutton : this.buttonList) {
guibutton.enabled = false;
for (int l = 0, m = this.buttonList.size(); l < m; ++l) {
this.buttonList.get(l).enabled = false;
}
}
@ -116,8 +116,8 @@ public class GuiYesNo extends GuiScreen {
public void updateScreen() {
super.updateScreen();
if (--this.ticksUntilEnable == 0) {
for (GuiButton guibutton : this.buttonList) {
guibutton.enabled = true;
for (int l = 0, m = this.buttonList.size(); l < m; ++l) {
this.buttonList.get(l).enabled = true;
}
}

View file

@ -47,7 +47,8 @@ public class ScreenChatOptions extends GuiScreen {
int i = 0;
this.field_146401_i = I18n.format("options.chat.title", new Object[0]);
for (GameSettings.Options gamesettings$options : field_146399_a) {
for (int j = 0; j < field_146399_a.length; ++j) {
GameSettings.Options gamesettings$options = field_146399_a[j];
if (gamesettings$options.getEnumFloat()) {
this.buttonList.add(new GuiOptionSlider(gamesettings$options.returnEnumOrdinal(),
this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), gamesettings$options));

View file

@ -421,7 +421,8 @@ public class GuiStats extends GuiScreen implements IProgressMeter {
super(mcIn);
this.statsHolder = Lists.newArrayList();
for (StatCrafting statcrafting : StatList.objectMineStats) {
for (int m = 0, l = StatList.objectMineStats.size(); m < l; ++m) {
StatCrafting statcrafting = StatList.objectMineStats.get(m);
boolean flag = false;
int i = Item.getIdFromItem(statcrafting.func_150959_a());
if (GuiStats.this.field_146546_t.readStat(statcrafting) > 0) {
@ -555,7 +556,8 @@ public class GuiStats extends GuiScreen implements IProgressMeter {
super(mcIn);
this.statsHolder = Lists.newArrayList();
for (StatCrafting statcrafting : StatList.itemStats) {
for (int m = 0, l = StatList.itemStats.size(); m < l; ++m) {
StatCrafting statcrafting = StatList.itemStats.get(m);
boolean flag = false;
int i = Item.getIdFromItem(statcrafting.func_150959_a());
if (GuiStats.this.field_146546_t.readStat(statcrafting) > 0) {

View file

@ -175,7 +175,8 @@ public class GuiBeacon extends GuiContainer {
this.drawCenteredString(this.fontRendererObj, I18n.format("tile.beacon.secondary", new Object[0]), 169, 10,
14737632);
for (GuiButton guibutton : this.buttonList) {
for (int k = 0, l = this.buttonList.size(); k < l; ++k) {
GuiButton guibutton = this.buttonList.get(k);
if (guibutton.isMouseOver()) {
guibutton.drawButtonForegroundLayer(i - this.guiLeft, j - this.guiTop);
break;

View file

@ -1,11 +1,11 @@
package net.minecraft.client.gui.inventory;
import java.util.List;
import java.util.Set;
import com.google.common.collect.Sets;
import net.lax1dude.eaglercraft.v1_8.Keyboard;
import net.lax1dude.eaglercraft.v1_8.internal.KeyboardConstants;
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.OpenGlHelper;
@ -455,7 +455,9 @@ public abstract class GuiContainer extends GuiScreen {
if (this.doubleClick && slot != null && k == 0 && this.inventorySlots.canMergeSlot((ItemStack) null, slot)) {
if (isShiftKeyDown()) {
if (slot != null && slot.inventory != null && this.shiftClickedSlot != null) {
for (Slot slot2 : this.inventorySlots.inventorySlots) {
List<Slot> lst = this.inventorySlots.inventorySlots;
for (int n = 0, m = lst.size(); n < m; ++n) {
Slot slot2 = lst.get(n);
if (slot2 != null && slot2.canTakeStack(this.mc.thePlayer) && slot2.getHasStack()
&& slot2.inventory == slot.inventory
&& Container.canAddItemToSlot(slot2, this.shiftClickedSlot, true)) {

View file

@ -310,7 +310,8 @@ public class GuiContainerCreative extends InventoryEffectRenderer {
}
}
for (Enchantment enchantment : Enchantment.enchantmentsBookList) {
for (int i = 0; i < Enchantment.enchantmentsBookList.length; ++i) {
Enchantment enchantment = Enchantment.enchantmentsBookList[i];
if (enchantment != null && enchantment.type != null) {
Items.enchanted_book.getAll(enchantment, guicontainercreative$containercreative.itemList);
}
@ -323,8 +324,9 @@ public class GuiContainerCreative extends InventoryEffectRenderer {
ItemStack itemstack = (ItemStack) iterator.next();
boolean flag = false;
for (String s : itemstack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips)) {
if (EnumChatFormatting.getTextWithoutFormattingCodes(s).toLowerCase().contains(s1)) {
List<String> lst = itemstack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips);
for (int i = 0, l = lst.size(); i < l; ++i) {
if (EnumChatFormatting.getTextWithoutFormattingCodes(lst.get(i)).toLowerCase().contains(s1)) {
flag = true;
break;
}
@ -362,8 +364,8 @@ public class GuiContainerCreative extends InventoryEffectRenderer {
int i = parInt1 - this.guiLeft;
int j = parInt2 - this.guiTop;
for (CreativeTabs creativetabs : CreativeTabs.creativeTabArray) {
if (this.func_147049_a(creativetabs, i, j)) {
for (int k = 0; k < CreativeTabs.creativeTabArray.length; ++k) {
if (this.func_147049_a(CreativeTabs.creativeTabArray[k], i, j)) {
return;
}
}
@ -381,7 +383,8 @@ public class GuiContainerCreative extends InventoryEffectRenderer {
int l = i - this.guiLeft;
int i1 = j - this.guiTop;
for (CreativeTabs creativetabs : CreativeTabs.creativeTabArray) {
for (int m = 0; m < CreativeTabs.creativeTabArray.length; ++m) {
CreativeTabs creativetabs = CreativeTabs.creativeTabArray[m];
if (this.func_147049_a(creativetabs, l, i1)) {
this.setCurrentCreativeTab(creativetabs);
return;
@ -520,8 +523,8 @@ public class GuiContainerCreative extends InventoryEffectRenderer {
super.drawScreen(i, j, f);
for (CreativeTabs creativetabs : CreativeTabs.creativeTabArray) {
if (this.renderCreativeInventoryHoveringText(creativetabs, i, j)) {
for (int m = 0; m < CreativeTabs.creativeTabArray.length; ++m) {
if (this.renderCreativeInventoryHoveringText(CreativeTabs.creativeTabArray[m], i, j)) {
Mouse.showCursor(EnumCursorType.HAND);
break;
}
@ -547,7 +550,8 @@ public class GuiContainerCreative extends InventoryEffectRenderer {
Enchantment enchantment = Enchantment
.getEnchantmentById(((Integer) map.keySet().iterator().next()).intValue());
for (CreativeTabs creativetabs1 : CreativeTabs.creativeTabArray) {
for (int m = 0; m < CreativeTabs.creativeTabArray.length; ++m) {
CreativeTabs creativetabs1 = CreativeTabs.creativeTabArray[m];
if (creativetabs1.hasRelevantEnchantmentType(enchantment.type)) {
creativetabs = creativetabs1;
break;
@ -584,7 +588,8 @@ public class GuiContainerCreative extends InventoryEffectRenderer {
RenderHelper.enableGUIStandardItemLighting();
CreativeTabs creativetabs = CreativeTabs.creativeTabArray[selectedTabIndex];
for (CreativeTabs creativetabs1 : CreativeTabs.creativeTabArray) {
for (int m = 0; m < CreativeTabs.creativeTabArray.length; ++m) {
CreativeTabs creativetabs1 = CreativeTabs.creativeTabArray[m];
this.mc.getTextureManager().bindTexture(creativeInventoryTabs);
if (creativetabs1.getTabIndex() != selectedTabIndex) {
this.func_147051_a(creativetabs1);

View file

@ -3,12 +3,10 @@ package net.minecraft.client.gui.spectator;
import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.gui.Gui;
import net.minecraft.network.play.client.C18PacketSpectate;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.ResourceLocation;
/**+
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.

View file

@ -57,7 +57,9 @@ public class TeleportToPlayer implements ISpectatorMenuView, ISpectatorMenuObjec
public TeleportToPlayer(Collection<NetworkPlayerInfo> parCollection) {
this.field_178673_b = Lists.newArrayList();
for (NetworkPlayerInfo networkplayerinfo : field_178674_a.sortedCopy(parCollection)) {
List<NetworkPlayerInfo> lst = field_178674_a.sortedCopy(parCollection);
for (int i = 0, l = lst.size(); i < l; ++i) {
NetworkPlayerInfo networkplayerinfo = lst.get(i);
if (networkplayerinfo.getGameType() != WorldSettings.GameType.SPECTATOR) {
this.field_178673_b.add(new PlayerMenuObject(networkplayerinfo.getGameProfile()));
}

View file

@ -1,13 +1,10 @@
package net.minecraft.client.gui.spectator.categories;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import com.google.common.collect.Lists;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiSpectator;
@ -76,8 +73,8 @@ public class TeleportToTeam implements ISpectatorMenuView, ISpectatorMenuObject
}
public boolean func_178662_A_() {
for (ISpectatorMenuObject ispectatormenuobject : this.field_178672_a) {
if (ispectatormenuobject.func_178662_A_()) {
for (int i = 0, l = this.field_178672_a.size(); i < l; ++i) {
if (this.field_178672_a.get(i).func_178662_A_()) {
return true;
}
}

View file

@ -26,8 +26,7 @@ import net.minecraft.util.Session;
*/
public class Main {
public static void appMain(String[] astring) {
System.setProperty("java.net.preferIPv4Stack", "true");
System.setProperty("java.net.preferIPv6Addresses", "true");
GameConfiguration gameconfiguration = new GameConfiguration(
new GameConfiguration.UserInformation(new Session()),
new GameConfiguration.DisplayInformation(854, 480, false, true),

View file

@ -74,8 +74,8 @@ public class ModelGhast extends ModelBase {
GlStateManager.translate(0.0F, 0.6F, 0.0F);
this.body.render(f5);
for (ModelRenderer modelrenderer : this.tentacles) {
modelrenderer.render(f5);
for (int i = 0; i < this.tentacles.length; ++i) {
this.tentacles[i].render(f5);
}
GlStateManager.popMatrix();

View file

@ -55,8 +55,8 @@ public class ModelSquid extends ModelBase {
* legs can swing at most.
*/
public void setRotationAngles(float var1, float var2, float f, float var4, float var5, float var6, Entity var7) {
for (ModelRenderer modelrenderer : this.squidTentacles) {
modelrenderer.rotateAngleX = f;
for (int i = 0; i < this.squidTentacles.length; ++i) {
this.squidTentacles[i].rotateAngleX = f;
}
}

View file

@ -63,12 +63,12 @@ public class ModelWither extends ModelBase {
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
for (ModelRenderer modelrenderer : this.field_82904_b) {
modelrenderer.render(f5);
for (int i = 0; i < this.field_82904_b.length; ++i) {
this.field_82904_b[i].render(f5);
}
for (ModelRenderer modelrenderer1 : this.field_82905_a) {
modelrenderer1.render(f5);
for (int i = 0; i < this.field_82905_a.length; ++i) {
this.field_82905_a[i].render(f5);
}
}

View file

@ -126,8 +126,8 @@ public class ChunkProviderClient implements IChunkProvider {
public boolean unloadQueuedChunks() {
long i = System.currentTimeMillis();
for (Chunk chunk : this.chunkListing) {
chunk.func_150804_b(System.currentTimeMillis() - i > 5L);
for (int j = 0, k = this.chunkListing.size(); j < k; ++j) {
this.chunkListing.get(j).func_150804_b(System.currentTimeMillis() - i > 5L);
}
if (System.currentTimeMillis() - i > 100L) {

View file

@ -153,6 +153,8 @@ public class ServerData {
public static enum ServerResourceMode {
ENABLED("enabled"), DISABLED("disabled"), PROMPT("prompt");
public static final ServerResourceMode[] _VALUES = values();
private final IChatComponent motd;
private ServerResourceMode(String parString2) {

Some files were not shown because too many files have changed in this diff Show more