id
int32
0
12.9k
code
sequencelengths
2
264k
9,900
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "io", ".", "*", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "NBTTagList", "extends", "NBTBase", "{", "private", "List", "tagList", ";", "private", "byte", "tagType", ";", "public", "NBTTagList", "(", ")", "{", "super", "(", "\"\"", ")", ";", "tagList", "=", "new", "ArrayList", "(", ")", ";", "}", "public", "NBTTagList", "(", "String", "par1Str", ")", "{", "super", "(", "par1Str", ")", ";", "tagList", "=", "new", "ArrayList", "(", ")", ";", "}", "void", "write", "(", "DataOutput", "par1DataOutput", ")", "throws", "IOException", "{", "if", "(", "tagList", ".", "size", "(", ")", ">", "0", ")", "{", "tagType", "=", "(", "(", "NBTBase", ")", "tagList", ".", "get", "(", "0", ")", ")", ".", "getId", "(", ")", ";", "}", "else", "{", "tagType", "=", "1", ";", "}", "par1DataOutput", ".", "writeByte", "(", "tagType", ")", ";", "par1DataOutput", ".", "writeInt", "(", "tagList", ".", "size", "(", ")", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "tagList", ".", "size", "(", ")", ";", "i", "++", ")", "{", "(", "(", "NBTBase", ")", "tagList", ".", "get", "(", "i", ")", ")", ".", "write", "(", "par1DataOutput", ")", ";", "}", "}", "void", "load", "(", "DataInput", "par1DataInput", ")", "throws", "IOException", "{", "tagType", "=", "par1DataInput", ".", "readByte", "(", ")", ";", "int", "i", "=", "par1DataInput", ".", "readInt", "(", ")", ";", "tagList", "=", "new", "ArrayList", "(", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "i", ";", "j", "++", ")", "{", "NBTBase", "nbtbase", "=", "NBTBase", ".", "newTag", "(", "tagType", ",", "null", ")", ";", "nbtbase", ".", "load", "(", "par1DataInput", ")", ";", "tagList", ".", "add", "(", "nbtbase", ")", ";", "}", "}", "public", "byte", "getId", "(", ")", "{", "return", "9", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "(", "new", "StringBuilder", "(", ")", ")", ".", "append", "(", "\"\"", ")", ".", "append", "(", "tagList", ".", "size", "(", ")", ")", ".", "append", "(", "\"\"", ")", ".", "append", "(", "NBTBase", ".", "getTagName", "(", "tagType", ")", ")", ".", "toString", "(", ")", ";", "}", "public", "void", "appendTag", "(", "NBTBase", "par1NBTBase", ")", "{", "tagType", "=", "par1NBTBase", ".", "getId", "(", ")", ";", "tagList", ".", "add", "(", "par1NBTBase", ")", ";", "}", "public", "NBTBase", "tagAt", "(", "int", "par1", ")", "{", "return", "(", "NBTBase", ")", "tagList", ".", "get", "(", "par1", ")", ";", "}", "public", "int", "tagCount", "(", ")", "{", "return", "tagList", ".", "size", "(", ")", ";", "}", "public", "NBTBase", "copy", "(", ")", "{", "NBTTagList", "nbttaglist", "=", "new", "NBTTagList", "(", "getName", "(", ")", ")", ";", "nbttaglist", ".", "tagType", "=", "tagType", ";", "NBTBase", "nbtbase1", ";", "for", "(", "Iterator", "iterator", "=", "tagList", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", "nbttaglist", ".", "tagList", ".", "add", "(", "nbtbase1", ")", ")", "{", "NBTBase", "nbtbase", "=", "(", "NBTBase", ")", "iterator", ".", "next", "(", ")", ";", "nbtbase1", "=", "nbtbase", ".", "copy", "(", ")", ";", "}", "return", "nbttaglist", ";", "}", "public", "boolean", "equals", "(", "Object", "par1Obj", ")", "{", "if", "(", "super", ".", "equals", "(", "par1Obj", ")", ")", "{", "NBTTagList", "nbttaglist", "=", "(", "NBTTagList", ")", "par1Obj", ";", "if", "(", "tagType", "==", "nbttaglist", ".", "tagType", ")", "{", "return", "tagList", ".", "equals", "(", "nbttaglist", ".", "tagList", ")", ";", "}", "}", "return", "false", ";", "}", "public", "int", "hashCode", "(", ")", "{", "return", "super", ".", "hashCode", "(", ")", "^", "tagList", ".", "hashCode", "(", ")", ";", "}", "}", "</s>" ]
9,901
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "io", ".", "*", ";", "import", "java", ".", "util", ".", "List", ";", "public", "class", "Packet40EntityMetadata", "extends", "Packet", "{", "public", "int", "entityId", ";", "private", "List", "metadata", ";", "public", "Packet40EntityMetadata", "(", ")", "{", "}", "public", "Packet40EntityMetadata", "(", "int", "par1", ",", "DataWatcher", "par2DataWatcher", ")", "{", "entityId", "=", "par1", ";", "metadata", "=", "par2DataWatcher", ".", "getChangedObjects", "(", ")", ";", "}", "public", "void", "readPacketData", "(", "DataInputStream", "par1DataInputStream", ")", "throws", "IOException", "{", "entityId", "=", "par1DataInputStream", ".", "readInt", "(", ")", ";", "metadata", "=", "DataWatcher", ".", "readWatchableObjects", "(", "par1DataInputStream", ")", ";", "}", "public", "void", "writePacketData", "(", "DataOutputStream", "par1DataOutputStream", ")", "throws", "IOException", "{", "par1DataOutputStream", ".", "writeInt", "(", "entityId", ")", ";", "DataWatcher", ".", "writeObjectsInListToStream", "(", "metadata", ",", "par1DataOutputStream", ")", ";", "}", "public", "void", "processPacket", "(", "NetHandler", "par1NetHandler", ")", "{", "par1NetHandler", ".", "handleEntityMetadata", "(", "this", ")", ";", "}", "public", "int", "getPacketSize", "(", ")", "{", "return", "5", ";", "}", "}", "</s>" ]
9,902
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "io", ".", "*", ";", "public", "class", "Packet9Respawn", "extends", "Packet", "{", "public", "int", "respawnDimension", ";", "public", "int", "difficulty", ";", "public", "int", "worldHeight", ";", "public", "int", "creativeMode", ";", "public", "WorldType", "terrainType", ";", "public", "Packet9Respawn", "(", ")", "{", "}", "public", "Packet9Respawn", "(", "int", "par1", ",", "byte", "par2", ",", "WorldType", "par3WorldType", ",", "int", "par4", ",", "int", "par5", ")", "{", "respawnDimension", "=", "par1", ";", "difficulty", "=", "par2", ";", "worldHeight", "=", "par4", ";", "creativeMode", "=", "par5", ";", "terrainType", "=", "par3WorldType", ";", "}", "public", "void", "processPacket", "(", "NetHandler", "par1NetHandler", ")", "{", "par1NetHandler", ".", "handleRespawn", "(", "this", ")", ";", "}", "public", "void", "readPacketData", "(", "DataInputStream", "par1DataInputStream", ")", "throws", "IOException", "{", "respawnDimension", "=", "par1DataInputStream", ".", "readInt", "(", ")", ";", "difficulty", "=", "par1DataInputStream", ".", "readByte", "(", ")", ";", "creativeMode", "=", "par1DataInputStream", ".", "readByte", "(", ")", ";", "worldHeight", "=", "par1DataInputStream", ".", "readShort", "(", ")", ";", "String", "s", "=", "readString", "(", "par1DataInputStream", ",", "16", ")", ";", "terrainType", "=", "WorldType", ".", "parseWorldType", "(", "s", ")", ";", "if", "(", "terrainType", "==", "null", ")", "{", "terrainType", "=", "WorldType", ".", "DEFAULT", ";", "}", "}", "public", "void", "writePacketData", "(", "DataOutputStream", "par1DataOutputStream", ")", "throws", "IOException", "{", "par1DataOutputStream", ".", "writeInt", "(", "respawnDimension", ")", ";", "par1DataOutputStream", ".", "writeByte", "(", "difficulty", ")", ";", "par1DataOutputStream", ".", "writeByte", "(", "creativeMode", ")", ";", "par1DataOutputStream", ".", "writeShort", "(", "worldHeight", ")", ";", "writeString", "(", "terrainType", ".", "func_48449_a", "(", ")", ",", "par1DataOutputStream", ")", ";", "}", "public", "int", "getPacketSize", "(", ")", "{", "return", "8", "+", "terrainType", ".", "func_48449_a", "(", ")", ".", "length", "(", ")", ";", "}", "}", "</s>" ]
9,903
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "enum", "EnumStatus", "{", "OK", ",", "NOT_POSSIBLE_HERE", ",", "NOT_POSSIBLE_NOW", ",", "TOO_FAR_AWAY", ",", "OTHER_PROBLEM", ",", "NOT_SAFE", ";", "}", "</s>" ]
9,904
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Random", ";", "public", "class", "BlockEndPortal", "extends", "BlockContainer", "{", "public", "static", "boolean", "bossDefeated", "=", "false", ";", "protected", "BlockEndPortal", "(", "int", "par1", ",", "Material", "par2Material", ")", "{", "super", "(", "par1", ",", "0", ",", "par2Material", ")", ";", "setLightValue", "(", "1.0F", ")", ";", "}", "public", "TileEntity", "getBlockEntity", "(", ")", "{", "return", "new", "TileEntityEndPortal", "(", ")", ";", "}", "public", "void", "setBlockBoundsBasedOnState", "(", "IBlockAccess", "par1IBlockAccess", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "float", "f", "=", "0.0625F", ";", "setBlockBounds", "(", "0.0F", ",", "0.0F", ",", "0.0F", ",", "1.0F", ",", "f", ",", "1.0F", ")", ";", "}", "public", "void", "getCollidingBoundingBoxes", "(", "World", "world", ",", "int", "i", ",", "int", "j", ",", "int", "k", ",", "AxisAlignedBB", "axisalignedbb", ",", "ArrayList", "arraylist", ")", "{", "}", "public", "boolean", "isOpaqueCube", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "renderAsNormalBlock", "(", ")", "{", "return", "false", ";", "}", "public", "int", "quantityDropped", "(", "Random", "par1Random", ")", "{", "return", "0", ";", "}", "public", "void", "onEntityCollidedWithBlock", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "Entity", "par5Entity", ")", "{", "if", "(", "par5Entity", ".", "ridingEntity", "==", "null", "&&", "par5Entity", ".", "riddenByEntity", "==", "null", "&&", "(", "par5Entity", "instanceof", "EntityPlayer", ")", "&&", "!", "par1World", ".", "isRemote", ")", "{", "(", "(", "EntityPlayer", ")", "par5Entity", ")", ".", "travelToTheEnd", "(", "1", ")", ";", "}", "}", "public", "int", "getRenderType", "(", ")", "{", "return", "-", "1", ";", "}", "public", "void", "onBlockAdded", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "if", "(", "bossDefeated", ")", "{", "return", ";", "}", "if", "(", "par1World", ".", "worldProvider", ".", "worldType", "!=", "0", ")", "{", "par1World", ".", "setBlockWithNotify", "(", "par2", ",", "par3", ",", "par4", ",", "0", ")", ";", "return", ";", "}", "else", "{", "return", ";", "}", "}", "}", "</s>" ]
9,905
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "ItemTool", "extends", "Item", "{", "private", "Block", "blocksEffectiveAgainst", "[", "]", ";", "protected", "float", "efficiencyOnProperMaterial", ";", "private", "int", "damageVsEntity", ";", "protected", "EnumToolMaterial", "toolMaterial", ";", "protected", "ItemTool", "(", "int", "par1", ",", "int", "par2", ",", "EnumToolMaterial", "par3EnumToolMaterial", ",", "Block", "par4ArrayOfBlock", "[", "]", ")", "{", "super", "(", "par1", ")", ";", "efficiencyOnProperMaterial", "=", "4F", ";", "toolMaterial", "=", "par3EnumToolMaterial", ";", "blocksEffectiveAgainst", "=", "par4ArrayOfBlock", ";", "maxStackSize", "=", "1", ";", "setMaxDamage", "(", "par3EnumToolMaterial", ".", "getMaxUses", "(", ")", ")", ";", "efficiencyOnProperMaterial", "=", "par3EnumToolMaterial", ".", "getEfficiencyOnProperMaterial", "(", ")", ";", "damageVsEntity", "=", "par2", "+", "par3EnumToolMaterial", ".", "getDamageVsEntity", "(", ")", ";", "}", "public", "float", "getStrVsBlock", "(", "ItemStack", "par1ItemStack", ",", "Block", "par2Block", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "blocksEffectiveAgainst", ".", "length", ";", "i", "++", ")", "{", "if", "(", "blocksEffectiveAgainst", "[", "i", "]", "==", "par2Block", ")", "{", "return", "efficiencyOnProperMaterial", ";", "}", "}", "return", "1.0F", ";", "}", "public", "boolean", "hitEntity", "(", "ItemStack", "par1ItemStack", ",", "EntityLiving", "par2EntityLiving", ",", "EntityLiving", "par3EntityLiving", ")", "{", "par1ItemStack", ".", "damageItem", "(", "2", ",", "par3EntityLiving", ")", ";", "return", "true", ";", "}", "public", "boolean", "onBlockDestroyed", "(", "ItemStack", "par1ItemStack", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "int", "par5", ",", "EntityLiving", "par6EntityLiving", ")", "{", "par1ItemStack", ".", "damageItem", "(", "1", ",", "par6EntityLiving", ")", ";", "return", "true", ";", "}", "public", "int", "getDamageVsEntity", "(", "Entity", "par1Entity", ")", "{", "return", "damageVsEntity", ";", "}", "public", "int", "getItemEnchantability", "(", ")", "{", "return", "toolMaterial", ".", "getEnchantability", "(", ")", ";", "}", "}", "</s>" ]
9,906
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "Random", ";", "public", "class", "BlockPortal", "extends", "BlockBreakable", "{", "public", "BlockPortal", "(", "int", "par1", ",", "int", "par2", ")", "{", "super", "(", "par1", ",", "par2", ",", "Material", ".", "portal", ",", "false", ")", ";", "}", "public", "AxisAlignedBB", "getCollisionBoundingBoxFromPool", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ",", "int", "i", ")", "{", "return", "null", ";", "}", "public", "void", "setBlockBoundsBasedOnState", "(", "IBlockAccess", "par1IBlockAccess", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "if", "(", "par1IBlockAccess", ".", "getBlockId", "(", "par2", "-", "1", ",", "par3", ",", "par4", ")", "==", "blockID", "||", "par1IBlockAccess", ".", "getBlockId", "(", "par2", "+", "1", ",", "par3", ",", "par4", ")", "==", "blockID", ")", "{", "float", "f", "=", "0.5F", ";", "float", "f2", "=", "0.125F", ";", "setBlockBounds", "(", "0.5F", "-", "f", ",", "0.0F", ",", "0.5F", "-", "f2", ",", "0.5F", "+", "f", ",", "1.0F", ",", "0.5F", "+", "f2", ")", ";", "}", "else", "{", "float", "f1", "=", "0.125F", ";", "float", "f3", "=", "0.5F", ";", "setBlockBounds", "(", "0.5F", "-", "f1", ",", "0.0F", ",", "0.5F", "-", "f3", ",", "0.5F", "+", "f1", ",", "1.0F", ",", "0.5F", "+", "f3", ")", ";", "}", "}", "public", "boolean", "isOpaqueCube", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "renderAsNormalBlock", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "tryToCreatePortal", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "int", "i", "=", "0", ";", "int", "j", "=", "0", ";", "if", "(", "par1World", ".", "getBlockId", "(", "par2", "-", "1", ",", "par3", ",", "par4", ")", "==", "Block", ".", "obsidian", ".", "blockID", "||", "par1World", ".", "getBlockId", "(", "par2", "+", "1", ",", "par3", ",", "par4", ")", "==", "Block", ".", "obsidian", ".", "blockID", ")", "{", "i", "=", "1", ";", "}", "if", "(", "par1World", ".", "getBlockId", "(", "par2", ",", "par3", ",", "par4", "-", "1", ")", "==", "Block", ".", "obsidian", ".", "blockID", "||", "par1World", ".", "getBlockId", "(", "par2", ",", "par3", ",", "par4", "+", "1", ")", "==", "Block", ".", "obsidian", ".", "blockID", ")", "{", "j", "=", "1", ";", "}", "if", "(", "i", "==", "j", ")", "{", "return", "false", ";", "}", "if", "(", "par1World", ".", "getBlockId", "(", "par2", "-", "i", ",", "par3", ",", "par4", "-", "j", ")", "==", "0", ")", "{", "par2", "-=", "i", ";", "par4", "-=", "j", ";", "}", "for", "(", "int", "k", "=", "-", "1", ";", "k", "<=", "2", ";", "k", "++", ")", "{", "for", "(", "int", "i1", "=", "-", "1", ";", "i1", "<=", "3", ";", "i1", "++", ")", "{", "boolean", "flag", "=", "k", "==", "-", "1", "||", "k", "==", "2", "||", "i1", "==", "-", "1", "||", "i1", "==", "3", ";", "if", "(", "(", "k", "==", "-", "1", "||", "k", "==", "2", ")", "&&", "(", "i1", "==", "-", "1", "||", "i1", "==", "3", ")", ")", "{", "continue", ";", "}", "int", "k1", "=", "par1World", ".", "getBlockId", "(", "par2", "+", "i", "*", "k", ",", "par3", "+", "i1", ",", "par4", "+", "j", "*", "k", ")", ";", "if", "(", "flag", ")", "{", "if", "(", "k1", "!=", "Block", ".", "obsidian", ".", "blockID", ")", "{", "return", "false", ";", "}", "continue", ";", "}", "if", "(", "k1", "!=", "0", "&&", "k1", "!=", "Block", ".", "fire", ".", "blockID", ")", "{", "return", "false", ";", "}", "}", "}", "par1World", ".", "editingBlocks", "=", "true", ";", "for", "(", "int", "l", "=", "0", ";", "l", "<", "2", ";", "l", "++", ")", "{", "for", "(", "int", "j1", "=", "0", ";", "j1", "<", "3", ";", "j1", "++", ")", "{", "par1World", ".", "setBlockWithNotify", "(", "par2", "+", "i", "*", "l", ",", "par3", "+", "j1", ",", "par4", "+", "j", "*", "l", ",", "Block", ".", "portal", ".", "blockID", ")", ";", "}", "}", "par1World", ".", "editingBlocks", "=", "false", ";", "return", "true", ";", "}", "public", "void", "onNeighborBlockChange", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "int", "par5", ")", "{", "int", "i", "=", "0", ";", "int", "j", "=", "1", ";", "if", "(", "par1World", ".", "getBlockId", "(", "par2", "-", "1", ",", "par3", ",", "par4", ")", "==", "blockID", "||", "par1World", ".", "getBlockId", "(", "par2", "+", "1", ",", "par3", ",", "par4", ")", "==", "blockID", ")", "{", "i", "=", "1", ";", "j", "=", "0", ";", "}", "int", "k", ";", "for", "(", "k", "=", "par3", ";", "par1World", ".", "getBlockId", "(", "par2", ",", "k", "-", "1", ",", "par4", ")", "==", "blockID", ";", "k", "--", ")", "{", "}", "if", "(", "par1World", ".", "getBlockId", "(", "par2", ",", "k", "-", "1", ",", "par4", ")", "!=", "Block", ".", "obsidian", ".", "blockID", ")", "{", "par1World", ".", "setBlockWithNotify", "(", "par2", ",", "par3", ",", "par4", ",", "0", ")", ";", "return", ";", "}", "int", "l", ";", "for", "(", "l", "=", "1", ";", "l", "<", "4", "&&", "par1World", ".", "getBlockId", "(", "par2", ",", "k", "+", "l", ",", "par4", ")", "==", "blockID", ";", "l", "++", ")", "{", "}", "if", "(", "l", "!=", "3", "||", "par1World", ".", "getBlockId", "(", "par2", ",", "k", "+", "l", ",", "par4", ")", "!=", "Block", ".", "obsidian", ".", "blockID", ")", "{", "par1World", ".", "setBlockWithNotify", "(", "par2", ",", "par3", ",", "par4", ",", "0", ")", ";", "return", ";", "}", "boolean", "flag", "=", "par1World", ".", "getBlockId", "(", "par2", "-", "1", ",", "par3", ",", "par4", ")", "==", "blockID", "||", "par1World", ".", "getBlockId", "(", "par2", "+", "1", ",", "par3", ",", "par4", ")", "==", "blockID", ";", "boolean", "flag1", "=", "par1World", ".", "getBlockId", "(", "par2", ",", "par3", ",", "par4", "-", "1", ")", "==", "blockID", "||", "par1World", ".", "getBlockId", "(", "par2", ",", "par3", ",", "par4", "+", "1", ")", "==", "blockID", ";", "if", "(", "flag", "&&", "flag1", ")", "{", "par1World", ".", "setBlockWithNotify", "(", "par2", ",", "par3", ",", "par4", ",", "0", ")", ";", "return", ";", "}", "if", "(", "(", "par1World", ".", "getBlockId", "(", "par2", "+", "i", ",", "par3", ",", "par4", "+", "j", ")", "!=", "Block", ".", "obsidian", ".", "blockID", "||", "par1World", ".", "getBlockId", "(", "par2", "-", "i", ",", "par3", ",", "par4", "-", "j", ")", "!=", "blockID", ")", "&&", "(", "par1World", ".", "getBlockId", "(", "par2", "-", "i", ",", "par3", ",", "par4", "-", "j", ")", "!=", "Block", ".", "obsidian", ".", "blockID", "||", "par1World", ".", "getBlockId", "(", "par2", "+", "i", ",", "par3", ",", "par4", "+", "j", ")", "!=", "blockID", ")", ")", "{", "par1World", ".", "setBlockWithNotify", "(", "par2", ",", "par3", ",", "par4", ",", "0", ")", ";", "return", ";", "}", "else", "{", "return", ";", "}", "}", "public", "int", "quantityDropped", "(", "Random", "par1Random", ")", "{", "return", "0", ";", "}", "public", "void", "onEntityCollidedWithBlock", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "Entity", "par5Entity", ")", "{", "if", "(", "par5Entity", ".", "ridingEntity", "==", "null", "&&", "par5Entity", ".", "riddenByEntity", "==", "null", ")", "{", "par5Entity", ".", "setInPortal", "(", ")", ";", "}", "}", "}", "</s>" ]
9,907
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "interface", "ICommandListener", "{", "public", "abstract", "void", "log", "(", "String", "s", ")", ";", "public", "abstract", "String", "getUsername", "(", ")", ";", "}", "</s>" ]
9,908
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "io", ".", "*", ";", "public", "class", "Packet32EntityLook", "extends", "Packet30Entity", "{", "public", "Packet32EntityLook", "(", ")", "{", "rotating", "=", "true", ";", "}", "public", "Packet32EntityLook", "(", "int", "par1", ",", "byte", "par2", ",", "byte", "par3", ")", "{", "super", "(", "par1", ")", ";", "yaw", "=", "par2", ";", "pitch", "=", "par3", ";", "rotating", "=", "true", ";", "}", "public", "void", "readPacketData", "(", "DataInputStream", "par1DataInputStream", ")", "throws", "IOException", "{", "super", ".", "readPacketData", "(", "par1DataInputStream", ")", ";", "yaw", "=", "par1DataInputStream", ".", "readByte", "(", ")", ";", "pitch", "=", "par1DataInputStream", ".", "readByte", "(", ")", ";", "}", "public", "void", "writePacketData", "(", "DataOutputStream", "par1DataOutputStream", ")", "throws", "IOException", "{", "super", ".", "writePacketData", "(", "par1DataOutputStream", ")", ";", "par1DataOutputStream", ".", "writeByte", "(", "yaw", ")", ";", "par1DataOutputStream", ".", "writeByte", "(", "pitch", ")", ";", "}", "public", "int", "getPacketSize", "(", ")", "{", "return", "6", ";", "}", "}", "</s>" ]
9,909
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "MapCoord", "{", "public", "byte", "field_28202_a", ";", "public", "byte", "centerX", ";", "public", "byte", "centerZ", ";", "public", "byte", "iconRotation", ";", "final", "MapData", "data", ";", "public", "MapCoord", "(", "MapData", "par1MapData", ",", "byte", "par2", ",", "byte", "par3", ",", "byte", "par4", ",", "byte", "par5", ")", "{", "data", "=", "par1MapData", ";", "field_28202_a", "=", "par2", ";", "centerX", "=", "par3", ";", "centerZ", "=", "par4", ";", "iconRotation", "=", "par5", ";", "}", "}", "</s>" ]
9,910
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "interface", "IProgressUpdate", "{", "public", "abstract", "void", "displaySavingString", "(", "String", "s", ")", ";", "public", "abstract", "void", "displayLoadingString", "(", "String", "s", ")", ";", "public", "abstract", "void", "setLoadingProgress", "(", "int", "i", ")", ";", "}", "</s>" ]
9,911
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "ItemDoor", "extends", "Item", "{", "private", "Material", "doorMaterial", ";", "public", "ItemDoor", "(", "int", "par1", ",", "Material", "par2Material", ")", "{", "super", "(", "par1", ")", ";", "doorMaterial", "=", "par2Material", ";", "maxStackSize", "=", "1", ";", "}", "public", "boolean", "onItemUse", "(", "ItemStack", "par1ItemStack", ",", "EntityPlayer", "par2EntityPlayer", ",", "World", "par3World", ",", "int", "par4", ",", "int", "par5", ",", "int", "par6", ",", "int", "par7", ")", "{", "if", "(", "par7", "!=", "1", ")", "{", "return", "false", ";", "}", "par5", "++", ";", "Block", "block", ";", "if", "(", "doorMaterial", "==", "Material", ".", "wood", ")", "{", "block", "=", "Block", ".", "doorWood", ";", "}", "else", "{", "block", "=", "Block", ".", "doorSteel", ";", "}", "if", "(", "!", "par2EntityPlayer", ".", "canPlayerEdit", "(", "par4", ",", "par5", ",", "par6", ")", "||", "!", "par2EntityPlayer", ".", "canPlayerEdit", "(", "par4", ",", "par5", "+", "1", ",", "par6", ")", ")", "{", "return", "false", ";", "}", "if", "(", "!", "block", ".", "canPlaceBlockAt", "(", "par3World", ",", "par4", ",", "par5", ",", "par6", ")", ")", "{", "return", "false", ";", "}", "else", "{", "int", "i", "=", "MathHelper", ".", "floor_double", "(", "(", "double", ")", "(", "(", "(", "par2EntityPlayer", ".", "rotationYaw", "+", "180F", ")", "*", "4F", ")", "/", "360F", ")", "-", "0.5D", ")", "&", "3", ";", "placeDoorBlock", "(", "par3World", ",", "par4", ",", "par5", ",", "par6", ",", "i", ",", "block", ")", ";", "par1ItemStack", ".", "stackSize", "--", ";", "return", "true", ";", "}", "}", "public", "static", "void", "placeDoorBlock", "(", "World", "par0World", ",", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "Block", "par5Block", ")", "{", "byte", "byte0", "=", "0", ";", "byte", "byte1", "=", "0", ";", "if", "(", "par4", "==", "0", ")", "{", "byte1", "=", "1", ";", "}", "if", "(", "par4", "==", "1", ")", "{", "byte0", "=", "-", "1", ";", "}", "if", "(", "par4", "==", "2", ")", "{", "byte1", "=", "-", "1", ";", "}", "if", "(", "par4", "==", "3", ")", "{", "byte0", "=", "1", ";", "}", "int", "i", "=", "(", "par0World", ".", "isBlockNormalCube", "(", "par1", "-", "byte0", ",", "par2", ",", "par3", "-", "byte1", ")", "?", "1", ":", "0", ")", "+", "(", "par0World", ".", "isBlockNormalCube", "(", "par1", "-", "byte0", ",", "par2", "+", "1", ",", "par3", "-", "byte1", ")", "?", "1", ":", "0", ")", ";", "int", "j", "=", "(", "par0World", ".", "isBlockNormalCube", "(", "par1", "+", "byte0", ",", "par2", ",", "par3", "+", "byte1", ")", "?", "1", ":", "0", ")", "+", "(", "par0World", ".", "isBlockNormalCube", "(", "par1", "+", "byte0", ",", "par2", "+", "1", ",", "par3", "+", "byte1", ")", "?", "1", ":", "0", ")", ";", "boolean", "flag", "=", "par0World", ".", "getBlockId", "(", "par1", "-", "byte0", ",", "par2", ",", "par3", "-", "byte1", ")", "==", "par5Block", ".", "blockID", "||", "par0World", ".", "getBlockId", "(", "par1", "-", "byte0", ",", "par2", "+", "1", ",", "par3", "-", "byte1", ")", "==", "par5Block", ".", "blockID", ";", "boolean", "flag1", "=", "par0World", ".", "getBlockId", "(", "par1", "+", "byte0", ",", "par2", ",", "par3", "+", "byte1", ")", "==", "par5Block", ".", "blockID", "||", "par0World", ".", "getBlockId", "(", "par1", "+", "byte0", ",", "par2", "+", "1", ",", "par3", "+", "byte1", ")", "==", "par5Block", ".", "blockID", ";", "boolean", "flag2", "=", "false", ";", "if", "(", "flag", "&&", "!", "flag1", ")", "{", "flag2", "=", "true", ";", "}", "else", "if", "(", "j", ">", "i", ")", "{", "flag2", "=", "true", ";", "}", "par0World", ".", "editingBlocks", "=", "true", ";", "par0World", ".", "setBlockAndMetadataWithNotify", "(", "par1", ",", "par2", ",", "par3", ",", "par5Block", ".", "blockID", ",", "par4", ")", ";", "par0World", ".", "setBlockAndMetadataWithNotify", "(", "par1", ",", "par2", "+", "1", ",", "par3", ",", "par5Block", ".", "blockID", ",", "8", "|", "(", "flag2", "?", "1", ":", "0", ")", ")", ";", "par0World", ".", "editingBlocks", "=", "false", ";", "par0World", ".", "notifyBlocksOfNeighborChange", "(", "par1", ",", "par2", ",", "par3", ",", "par5Block", ".", "blockID", ")", ";", "par0World", ".", "notifyBlocksOfNeighborChange", "(", "par1", ",", "par2", "+", "1", ",", "par3", ",", "par5Block", ".", "blockID", ")", ";", "}", "}", "</s>" ]
9,912
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "GenLayerShore", "extends", "GenLayer", "{", "public", "GenLayerShore", "(", "long", "par1", ",", "GenLayer", "par3GenLayer", ")", "{", "super", "(", "par1", ")", ";", "parent", "=", "par3GenLayer", ";", "}", "public", "int", "[", "]", "getInts", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "int", "ai", "[", "]", "=", "parent", ".", "getInts", "(", "par1", "-", "1", ",", "par2", "-", "1", ",", "par3", "+", "2", ",", "par4", "+", "2", ")", ";", "int", "ai1", "[", "]", "=", "IntCache", ".", "getIntCache", "(", "par3", "*", "par4", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "par4", ";", "i", "++", ")", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<", "par3", ";", "j", "++", ")", "{", "initChunkSeed", "(", "j", "+", "par1", ",", "i", "+", "par2", ")", ";", "int", "k", "=", "ai", "[", "j", "+", "1", "+", "(", "i", "+", "1", ")", "*", "(", "par3", "+", "2", ")", "]", ";", "if", "(", "k", "==", "BiomeGenBase", ".", "mushroomIsland", ".", "biomeID", ")", "{", "int", "l", "=", "ai", "[", "j", "+", "1", "+", "(", "(", "i", "+", "1", ")", "-", "1", ")", "*", "(", "par3", "+", "2", ")", "]", ";", "int", "k1", "=", "ai", "[", "j", "+", "1", "+", "1", "+", "(", "i", "+", "1", ")", "*", "(", "par3", "+", "2", ")", "]", ";", "int", "j2", "=", "ai", "[", "(", "(", "j", "+", "1", ")", "-", "1", ")", "+", "(", "i", "+", "1", ")", "*", "(", "par3", "+", "2", ")", "]", ";", "int", "i3", "=", "ai", "[", "j", "+", "1", "+", "(", "i", "+", "1", "+", "1", ")", "*", "(", "par3", "+", "2", ")", "]", ";", "if", "(", "l", "==", "BiomeGenBase", ".", "ocean", ".", "biomeID", "||", "k1", "==", "BiomeGenBase", ".", "ocean", ".", "biomeID", "||", "j2", "==", "BiomeGenBase", ".", "ocean", ".", "biomeID", "||", "i3", "==", "BiomeGenBase", ".", "ocean", ".", "biomeID", ")", "{", "ai1", "[", "j", "+", "i", "*", "par3", "]", "=", "BiomeGenBase", ".", "mushroomIslandShore", ".", "biomeID", ";", "}", "else", "{", "ai1", "[", "j", "+", "i", "*", "par3", "]", "=", "k", ";", "}", "continue", ";", "}", "if", "(", "k", "!=", "BiomeGenBase", ".", "ocean", ".", "biomeID", "&&", "k", "!=", "BiomeGenBase", ".", "river", ".", "biomeID", "&&", "k", "!=", "BiomeGenBase", ".", "swampland", ".", "biomeID", "&&", "k", "!=", "BiomeGenBase", ".", "extremeHills", ".", "biomeID", ")", "{", "int", "i1", "=", "ai", "[", "j", "+", "1", "+", "(", "(", "i", "+", "1", ")", "-", "1", ")", "*", "(", "par3", "+", "2", ")", "]", ";", "int", "l1", "=", "ai", "[", "j", "+", "1", "+", "1", "+", "(", "i", "+", "1", ")", "*", "(", "par3", "+", "2", ")", "]", ";", "int", "k2", "=", "ai", "[", "(", "(", "j", "+", "1", ")", "-", "1", ")", "+", "(", "i", "+", "1", ")", "*", "(", "par3", "+", "2", ")", "]", ";", "int", "j3", "=", "ai", "[", "j", "+", "1", "+", "(", "i", "+", "1", "+", "1", ")", "*", "(", "par3", "+", "2", ")", "]", ";", "if", "(", "i1", "==", "BiomeGenBase", ".", "ocean", ".", "biomeID", "||", "l1", "==", "BiomeGenBase", ".", "ocean", ".", "biomeID", "||", "k2", "==", "BiomeGenBase", ".", "ocean", ".", "biomeID", "||", "j3", "==", "BiomeGenBase", ".", "ocean", ".", "biomeID", ")", "{", "ai1", "[", "j", "+", "i", "*", "par3", "]", "=", "BiomeGenBase", ".", "beach", ".", "biomeID", ";", "}", "else", "{", "ai1", "[", "j", "+", "i", "*", "par3", "]", "=", "k", ";", "}", "continue", ";", "}", "if", "(", "k", "==", "BiomeGenBase", ".", "extremeHills", ".", "biomeID", ")", "{", "int", "j1", "=", "ai", "[", "j", "+", "1", "+", "(", "(", "i", "+", "1", ")", "-", "1", ")", "*", "(", "par3", "+", "2", ")", "]", ";", "int", "i2", "=", "ai", "[", "j", "+", "1", "+", "1", "+", "(", "i", "+", "1", ")", "*", "(", "par3", "+", "2", ")", "]", ";", "int", "l2", "=", "ai", "[", "(", "(", "j", "+", "1", ")", "-", "1", ")", "+", "(", "i", "+", "1", ")", "*", "(", "par3", "+", "2", ")", "]", ";", "int", "k3", "=", "ai", "[", "j", "+", "1", "+", "(", "i", "+", "1", "+", "1", ")", "*", "(", "par3", "+", "2", ")", "]", ";", "if", "(", "j1", "!=", "BiomeGenBase", ".", "extremeHills", ".", "biomeID", "||", "i2", "!=", "BiomeGenBase", ".", "extremeHills", ".", "biomeID", "||", "l2", "!=", "BiomeGenBase", ".", "extremeHills", ".", "biomeID", "||", "k3", "!=", "BiomeGenBase", ".", "extremeHills", ".", "biomeID", ")", "{", "ai1", "[", "j", "+", "i", "*", "par3", "]", "=", "BiomeGenBase", ".", "extremeHillsEdge", ".", "biomeID", ";", "}", "else", "{", "ai1", "[", "j", "+", "i", "*", "par3", "]", "=", "k", ";", "}", "}", "else", "{", "ai1", "[", "j", "+", "i", "*", "par3", "]", "=", "k", ";", "}", "}", "}", "return", "ai1", ";", "}", "}", "</s>" ]
9,913
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "io", ".", "*", ";", "public", "class", "Packet106Transaction", "extends", "Packet", "{", "public", "int", "windowId", ";", "public", "short", "shortWindowId", ";", "public", "boolean", "accepted", ";", "public", "Packet106Transaction", "(", ")", "{", "}", "public", "Packet106Transaction", "(", "int", "par1", ",", "short", "par2", ",", "boolean", "par3", ")", "{", "windowId", "=", "par1", ";", "shortWindowId", "=", "par2", ";", "accepted", "=", "par3", ";", "}", "public", "void", "processPacket", "(", "NetHandler", "par1NetHandler", ")", "{", "par1NetHandler", ".", "handleTransaction", "(", "this", ")", ";", "}", "public", "void", "readPacketData", "(", "DataInputStream", "par1DataInputStream", ")", "throws", "IOException", "{", "windowId", "=", "par1DataInputStream", ".", "readByte", "(", ")", ";", "shortWindowId", "=", "par1DataInputStream", ".", "readShort", "(", ")", ";", "accepted", "=", "par1DataInputStream", ".", "readByte", "(", ")", "!=", "0", ";", "}", "public", "void", "writePacketData", "(", "DataOutputStream", "par1DataOutputStream", ")", "throws", "IOException", "{", "par1DataOutputStream", ".", "writeByte", "(", "windowId", ")", ";", "par1DataOutputStream", ".", "writeShort", "(", "shortWindowId", ")", ";", "par1DataOutputStream", ".", "writeByte", "(", "accepted", "?", "1", ":", "0", ")", ";", "}", "public", "int", "getPacketSize", "(", ")", "{", "return", "4", ";", "}", "}", "</s>" ]
9,914
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "List", ";", "public", "class", "IntCache", "{", "private", "static", "int", "intCacheSize", "=", "256", ";", "private", "static", "List", "freeSmallArrays", "=", "new", "ArrayList", "(", ")", ";", "private", "static", "List", "inUseSmallArrays", "=", "new", "ArrayList", "(", ")", ";", "private", "static", "List", "freeLargeArrays", "=", "new", "ArrayList", "(", ")", ";", "private", "static", "List", "inUseLargeArrays", "=", "new", "ArrayList", "(", ")", ";", "public", "IntCache", "(", ")", "{", "}", "public", "static", "int", "[", "]", "getIntCache", "(", "int", "par0", ")", "{", "if", "(", "par0", "<=", "256", ")", "{", "if", "(", "freeSmallArrays", ".", "size", "(", ")", "==", "0", ")", "{", "int", "ai", "[", "]", "=", "new", "int", "[", "256", "]", ";", "inUseSmallArrays", ".", "add", "(", "ai", ")", ";", "return", "ai", ";", "}", "else", "{", "int", "ai1", "[", "]", "=", "(", "int", "[", "]", ")", "freeSmallArrays", ".", "remove", "(", "freeSmallArrays", ".", "size", "(", ")", "-", "1", ")", ";", "inUseSmallArrays", ".", "add", "(", "ai1", ")", ";", "return", "ai1", ";", "}", "}", "if", "(", "par0", ">", "intCacheSize", ")", "{", "intCacheSize", "=", "par0", ";", "freeLargeArrays", ".", "clear", "(", ")", ";", "inUseLargeArrays", ".", "clear", "(", ")", ";", "int", "ai2", "[", "]", "=", "new", "int", "[", "intCacheSize", "]", ";", "inUseLargeArrays", ".", "add", "(", "ai2", ")", ";", "return", "ai2", ";", "}", "if", "(", "freeLargeArrays", ".", "size", "(", ")", "==", "0", ")", "{", "int", "ai3", "[", "]", "=", "new", "int", "[", "intCacheSize", "]", ";", "inUseLargeArrays", ".", "add", "(", "ai3", ")", ";", "return", "ai3", ";", "}", "else", "{", "int", "ai4", "[", "]", "=", "(", "int", "[", "]", ")", "freeLargeArrays", ".", "remove", "(", "freeLargeArrays", ".", "size", "(", ")", "-", "1", ")", ";", "inUseLargeArrays", ".", "add", "(", "ai4", ")", ";", "return", "ai4", ";", "}", "}", "public", "static", "void", "resetIntCache", "(", ")", "{", "if", "(", "freeLargeArrays", ".", "size", "(", ")", ">", "0", ")", "{", "freeLargeArrays", ".", "remove", "(", "freeLargeArrays", ".", "size", "(", ")", "-", "1", ")", ";", "}", "if", "(", "freeSmallArrays", ".", "size", "(", ")", ">", "0", ")", "{", "freeSmallArrays", ".", "remove", "(", "freeSmallArrays", ".", "size", "(", ")", "-", "1", ")", ";", "}", "freeLargeArrays", ".", "addAll", "(", "inUseLargeArrays", ")", ";", "freeSmallArrays", ".", "addAll", "(", "inUseSmallArrays", ")", ";", "inUseLargeArrays", ".", "clear", "(", ")", ";", "inUseSmallArrays", ".", "clear", "(", ")", ";", "}", "}", "</s>" ]
9,915
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "Random", ";", "public", "class", "BlockRedstoneOre", "extends", "Block", "{", "private", "boolean", "glowing", ";", "public", "BlockRedstoneOre", "(", "int", "par1", ",", "int", "par2", ",", "boolean", "par3", ")", "{", "super", "(", "par1", ",", "par2", ",", "Material", ".", "rock", ")", ";", "if", "(", "par3", ")", "{", "setTickRandomly", "(", "true", ")", ";", "}", "glowing", "=", "par3", ";", "}", "public", "int", "tickRate", "(", ")", "{", "return", "30", ";", "}", "public", "void", "onBlockClicked", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "EntityPlayer", "par5EntityPlayer", ")", "{", "glow", "(", "par1World", ",", "par2", ",", "par3", ",", "par4", ")", ";", "super", ".", "onBlockClicked", "(", "par1World", ",", "par2", ",", "par3", ",", "par4", ",", "par5EntityPlayer", ")", ";", "}", "public", "void", "onEntityWalking", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "Entity", "par5Entity", ")", "{", "glow", "(", "par1World", ",", "par2", ",", "par3", ",", "par4", ")", ";", "super", ".", "onEntityWalking", "(", "par1World", ",", "par2", ",", "par3", ",", "par4", ",", "par5Entity", ")", ";", "}", "public", "boolean", "blockActivated", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "EntityPlayer", "par5EntityPlayer", ")", "{", "glow", "(", "par1World", ",", "par2", ",", "par3", ",", "par4", ")", ";", "return", "super", ".", "blockActivated", "(", "par1World", ",", "par2", ",", "par3", ",", "par4", ",", "par5EntityPlayer", ")", ";", "}", "private", "void", "glow", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "sparkle", "(", "par1World", ",", "par2", ",", "par3", ",", "par4", ")", ";", "if", "(", "blockID", "==", "Block", ".", "oreRedstone", ".", "blockID", ")", "{", "par1World", ".", "setBlockWithNotify", "(", "par2", ",", "par3", ",", "par4", ",", "Block", ".", "oreRedstoneGlowing", ".", "blockID", ")", ";", "}", "}", "public", "void", "updateTick", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "Random", "par5Random", ")", "{", "if", "(", "blockID", "==", "Block", ".", "oreRedstoneGlowing", ".", "blockID", ")", "{", "par1World", ".", "setBlockWithNotify", "(", "par2", ",", "par3", ",", "par4", ",", "Block", ".", "oreRedstone", ".", "blockID", ")", ";", "}", "}", "public", "int", "idDropped", "(", "int", "par1", ",", "Random", "par2Random", ",", "int", "par3", ")", "{", "return", "Item", ".", "redstone", ".", "shiftedIndex", ";", "}", "public", "int", "quantityDroppedWithBonus", "(", "int", "par1", ",", "Random", "par2Random", ")", "{", "return", "quantityDropped", "(", "par2Random", ")", "+", "par2Random", ".", "nextInt", "(", "par1", "+", "1", ")", ";", "}", "public", "int", "quantityDropped", "(", "Random", "par1Random", ")", "{", "return", "4", "+", "par1Random", ".", "nextInt", "(", "2", ")", ";", "}", "private", "void", "sparkle", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "Random", "random", "=", "par1World", ".", "rand", ";", "double", "d", "=", "0.0625D", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "6", ";", "i", "++", ")", "{", "double", "d1", "=", "(", "float", ")", "par2", "+", "random", ".", "nextFloat", "(", ")", ";", "double", "d2", "=", "(", "float", ")", "par3", "+", "random", ".", "nextFloat", "(", ")", ";", "double", "d3", "=", "(", "float", ")", "par4", "+", "random", ".", "nextFloat", "(", ")", ";", "if", "(", "i", "==", "0", "&&", "!", "par1World", ".", "isBlockOpaqueCube", "(", "par2", ",", "par3", "+", "1", ",", "par4", ")", ")", "{", "d2", "=", "(", "double", ")", "(", "par3", "+", "1", ")", "+", "d", ";", "}", "if", "(", "i", "==", "1", "&&", "!", "par1World", ".", "isBlockOpaqueCube", "(", "par2", ",", "par3", "-", "1", ",", "par4", ")", ")", "{", "d2", "=", "(", "double", ")", "(", "par3", "+", "0", ")", "-", "d", ";", "}", "if", "(", "i", "==", "2", "&&", "!", "par1World", ".", "isBlockOpaqueCube", "(", "par2", ",", "par3", ",", "par4", "+", "1", ")", ")", "{", "d3", "=", "(", "double", ")", "(", "par4", "+", "1", ")", "+", "d", ";", "}", "if", "(", "i", "==", "3", "&&", "!", "par1World", ".", "isBlockOpaqueCube", "(", "par2", ",", "par3", ",", "par4", "-", "1", ")", ")", "{", "d3", "=", "(", "double", ")", "(", "par4", "+", "0", ")", "-", "d", ";", "}", "if", "(", "i", "==", "4", "&&", "!", "par1World", ".", "isBlockOpaqueCube", "(", "par2", "+", "1", ",", "par3", ",", "par4", ")", ")", "{", "d1", "=", "(", "double", ")", "(", "par2", "+", "1", ")", "+", "d", ";", "}", "if", "(", "i", "==", "5", "&&", "!", "par1World", ".", "isBlockOpaqueCube", "(", "par2", "-", "1", ",", "par3", ",", "par4", ")", ")", "{", "d1", "=", "(", "double", ")", "(", "par2", "+", "0", ")", "-", "d", ";", "}", "if", "(", "d1", "<", "(", "double", ")", "par2", "||", "d1", ">", "(", "double", ")", "(", "par2", "+", "1", ")", "||", "d2", "<", "0.0D", "||", "d2", ">", "(", "double", ")", "(", "par3", "+", "1", ")", "||", "d3", "<", "(", "double", ")", "par4", "||", "d3", ">", "(", "double", ")", "(", "par4", "+", "1", ")", ")", "{", "par1World", ".", "spawnParticle", "(", "\"reddust\"", ",", "d1", ",", "d2", ",", "d3", ",", "0.0D", ",", "0.0D", ",", "0.0D", ")", ";", "}", "}", "}", "protected", "ItemStack", "createStackedBlock", "(", "int", "par1", ")", "{", "return", "new", "ItemStack", "(", "Block", ".", "oreRedstone", ")", ";", "}", "}", "</s>" ]
9,916
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "Village", "{", "private", "final", "World", "worldObj", ";", "private", "final", "List", "villageDoorInfoList", "=", "new", "ArrayList", "(", ")", ";", "private", "final", "ChunkCoordinates", "centerHelper", "=", "new", "ChunkCoordinates", "(", "0", ",", "0", ",", "0", ")", ";", "private", "final", "ChunkCoordinates", "center", "=", "new", "ChunkCoordinates", "(", "0", ",", "0", ",", "0", ")", ";", "private", "int", "villageRadius", ";", "private", "int", "lastAddDoorTimestamp", ";", "private", "int", "tickCounter", ";", "private", "int", "numVillagers", ";", "private", "List", "villageAgressors", ";", "private", "int", "numIronGolems", ";", "public", "Village", "(", "World", "par1World", ")", "{", "villageRadius", "=", "0", ";", "lastAddDoorTimestamp", "=", "0", ";", "tickCounter", "=", "0", ";", "numVillagers", "=", "0", ";", "villageAgressors", "=", "new", "ArrayList", "(", ")", ";", "numIronGolems", "=", "0", ";", "worldObj", "=", "par1World", ";", "}", "public", "void", "tick", "(", "int", "par1", ")", "{", "tickCounter", "=", "par1", ";", "removeDeadAndOutOfRangeDoors", "(", ")", ";", "removeDeadAndOldAgressors", "(", ")", ";", "if", "(", "par1", "%", "20", "==", "0", ")", "{", "updateNumVillagers", "(", ")", ";", "}", "if", "(", "par1", "%", "30", "==", "0", ")", "{", "updateNumIronGolems", "(", ")", ";", "}", "int", "i", "=", "numVillagers", "/", "16", ";", "if", "(", "numIronGolems", "<", "i", "&&", "villageDoorInfoList", ".", "size", "(", ")", ">", "20", "&&", "worldObj", ".", "rand", ".", "nextInt", "(", "7000", ")", "==", "0", ")", "{", "Vec3D", "vec3d", "=", "tryGetIronGolemSpawningLocation", "(", "MathHelper", ".", "floor_float", "(", "center", ".", "posX", ")", ",", "MathHelper", ".", "floor_float", "(", "center", ".", "posY", ")", ",", "MathHelper", ".", "floor_float", "(", "center", ".", "posZ", ")", ",", "2", ",", "4", ",", "2", ")", ";", "if", "(", "vec3d", "!=", "null", ")", "{", "EntityIronGolem", "entityirongolem", "=", "new", "EntityIronGolem", "(", "worldObj", ")", ";", "entityirongolem", ".", "setPosition", "(", "vec3d", ".", "xCoord", ",", "vec3d", ".", "yCoord", ",", "vec3d", ".", "zCoord", ")", ";", "worldObj", ".", "spawnEntityInWorld", "(", "entityirongolem", ")", ";", "numIronGolems", "++", ";", "}", "}", "}", "private", "Vec3D", "tryGetIronGolemSpawningLocation", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "int", "par5", ",", "int", "par6", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "10", ";", "i", "++", ")", "{", "int", "j", "=", "(", "par1", "+", "worldObj", ".", "rand", ".", "nextInt", "(", "16", ")", ")", "-", "8", ";", "int", "k", "=", "(", "par2", "+", "worldObj", ".", "rand", ".", "nextInt", "(", "6", ")", ")", "-", "3", ";", "int", "l", "=", "(", "par3", "+", "worldObj", ".", "rand", ".", "nextInt", "(", "16", ")", ")", "-", "8", ";", "if", "(", "isInRange", "(", "j", ",", "k", ",", "l", ")", "&&", "isValidIronGolemSpawningLocation", "(", "j", ",", "k", ",", "l", ",", "par4", ",", "par5", ",", "par6", ")", ")", "{", "return", "Vec3D", ".", "createVector", "(", "j", ",", "k", ",", "l", ")", ";", "}", "}", "return", "null", ";", "}", "private", "boolean", "isValidIronGolemSpawningLocation", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "int", "par5", ",", "int", "par6", ")", "{", "if", "(", "!", "worldObj", ".", "isBlockNormalCube", "(", "par1", ",", "par2", "-", "1", ",", "par3", ")", ")", "{", "return", "false", ";", "}", "int", "i", "=", "par1", "-", "par4", "/", "2", ";", "int", "j", "=", "par3", "-", "par6", "/", "2", ";", "for", "(", "int", "k", "=", "i", ";", "k", "<", "i", "+", "par4", ";", "k", "++", ")", "{", "for", "(", "int", "l", "=", "par2", ";", "l", "<", "par2", "+", "par5", ";", "l", "++", ")", "{", "for", "(", "int", "i1", "=", "j", ";", "i1", "<", "j", "+", "par6", ";", "i1", "++", ")", "{", "if", "(", "worldObj", ".", "isBlockNormalCube", "(", "k", ",", "l", ",", "i1", ")", ")", "{", "return", "false", ";", "}", "}", "}", "}", "return", "true", ";", "}", "private", "void", "updateNumIronGolems", "(", ")", "{", "List", "list", "=", "worldObj", ".", "getEntitiesWithinAABB", "(", "net", ".", "minecraft", ".", "src", ".", "EntityIronGolem", ".", "class", ",", "AxisAlignedBB", ".", "getBoundingBoxFromPool", "(", "center", ".", "posX", "-", "villageRadius", ",", "center", ".", "posY", "-", "4", ",", "center", ".", "posZ", "-", "villageRadius", ",", "center", ".", "posX", "+", "villageRadius", ",", "center", ".", "posY", "+", "4", ",", "center", ".", "posZ", "+", "villageRadius", ")", ")", ";", "numIronGolems", "=", "list", ".", "size", "(", ")", ";", "}", "private", "void", "updateNumVillagers", "(", ")", "{", "List", "list", "=", "worldObj", ".", "getEntitiesWithinAABB", "(", "net", ".", "minecraft", ".", "src", ".", "EntityVillager", ".", "class", ",", "AxisAlignedBB", ".", "getBoundingBoxFromPool", "(", "center", ".", "posX", "-", "villageRadius", ",", "center", ".", "posY", "-", "4", ",", "center", ".", "posZ", "-", "villageRadius", ",", "center", ".", "posX", "+", "villageRadius", ",", "center", ".", "posY", "+", "4", ",", "center", ".", "posZ", "+", "villageRadius", ")", ")", ";", "numVillagers", "=", "list", ".", "size", "(", ")", ";", "}", "public", "ChunkCoordinates", "getCenter", "(", ")", "{", "return", "center", ";", "}", "public", "int", "getVillageRadius", "(", ")", "{", "return", "villageRadius", ";", "}", "public", "int", "getNumVillageDoors", "(", ")", "{", "return", "villageDoorInfoList", ".", "size", "(", ")", ";", "}", "public", "int", "getTicksSinceLastDoorAdding", "(", ")", "{", "return", "tickCounter", "-", "lastAddDoorTimestamp", ";", "}", "public", "int", "getNumVillagers", "(", ")", "{", "return", "numVillagers", ";", "}", "public", "boolean", "isInRange", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "return", "center", ".", "getDistanceSquared", "(", "par1", ",", "par2", ",", "par3", ")", "<", "(", "float", ")", "(", "villageRadius", "*", "villageRadius", ")", ";", "}", "public", "List", "getVillageDoorInfoList", "(", ")", "{", "return", "villageDoorInfoList", ";", "}", "public", "VillageDoorInfo", "findNearestDoor", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "VillageDoorInfo", "villagedoorinfo", "=", "null", ";", "int", "i", "=", "0x7fffffff", ";", "Iterator", "iterator", "=", "villageDoorInfoList", ".", "iterator", "(", ")", ";", "do", "{", "if", "(", "!", "iterator", ".", "hasNext", "(", ")", ")", "{", "break", ";", "}", "VillageDoorInfo", "villagedoorinfo1", "=", "(", "VillageDoorInfo", ")", "iterator", ".", "next", "(", ")", ";", "int", "j", "=", "villagedoorinfo1", ".", "getDistanceSquared", "(", "par1", ",", "par2", ",", "par3", ")", ";", "if", "(", "j", "<", "i", ")", "{", "villagedoorinfo", "=", "villagedoorinfo1", ";", "i", "=", "j", ";", "}", "}", "while", "(", "true", ")", ";", "return", "villagedoorinfo", ";", "}", "public", "VillageDoorInfo", "findNearestDoorUnrestricted", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "VillageDoorInfo", "villagedoorinfo", "=", "null", ";", "int", "i", "=", "0x7fffffff", ";", "Iterator", "iterator", "=", "villageDoorInfoList", ".", "iterator", "(", ")", ";", "do", "{", "if", "(", "!", "iterator", ".", "hasNext", "(", ")", ")", "{", "break", ";", "}", "VillageDoorInfo", "villagedoorinfo1", "=", "(", "VillageDoorInfo", ")", "iterator", ".", "next", "(", ")", ";", "int", "j", "=", "villagedoorinfo1", ".", "getDistanceSquared", "(", "par1", ",", "par2", ",", "par3", ")", ";", "if", "(", "j", ">", "256", ")", "{", "j", "*=", "1000", ";", "}", "else", "{", "j", "=", "villagedoorinfo1", ".", "getDoorOpeningRestrictionCounter", "(", ")", ";", "}", "if", "(", "j", "<", "i", ")", "{", "villagedoorinfo", "=", "villagedoorinfo1", ";", "i", "=", "j", ";", "}", "}", "while", "(", "true", ")", ";", "return", "villagedoorinfo", ";", "}", "public", "VillageDoorInfo", "getVillageDoorAt", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "if", "(", "center", ".", "getDistanceSquared", "(", "par1", ",", "par2", ",", "par3", ")", ">", "(", "float", ")", "(", "villageRadius", "*", "villageRadius", ")", ")", "{", "return", "null", ";", "}", "for", "(", "Iterator", "iterator", "=", "villageDoorInfoList", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", ")", "{", "VillageDoorInfo", "villagedoorinfo", "=", "(", "VillageDoorInfo", ")", "iterator", ".", "next", "(", ")", ";", "if", "(", "villagedoorinfo", ".", "posX", "==", "par1", "&&", "villagedoorinfo", ".", "posZ", "==", "par3", "&&", "Math", ".", "abs", "(", "villagedoorinfo", ".", "posY", "-", "par2", ")", "<=", "1", ")", "{", "return", "villagedoorinfo", ";", "}", "}", "return", "null", ";", "}", "public", "void", "addVillageDoorInfo", "(", "VillageDoorInfo", "par1VillageDoorInfo", ")", "{", "villageDoorInfoList", ".", "add", "(", "par1VillageDoorInfo", ")", ";", "centerHelper", ".", "posX", "+=", "par1VillageDoorInfo", ".", "posX", ";", "centerHelper", ".", "posY", "+=", "par1VillageDoorInfo", ".", "posY", ";", "centerHelper", ".", "posZ", "+=", "par1VillageDoorInfo", ".", "posZ", ";", "updateVillageRadiusAndCenter", "(", ")", ";", "lastAddDoorTimestamp", "=", "par1VillageDoorInfo", ".", "lastActivityTimestamp", ";", "}", "public", "boolean", "isAnnihilated", "(", ")", "{", "return", "villageDoorInfoList", ".", "isEmpty", "(", ")", ";", "}", "public", "void", "addOrRenewAgressor", "(", "EntityLiving", "par1EntityLiving", ")", "{", "for", "(", "Iterator", "iterator", "=", "villageAgressors", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", ")", "{", "VillageAgressor", "villageagressor", "=", "(", "VillageAgressor", ")", "iterator", ".", "next", "(", ")", ";", "if", "(", "villageagressor", ".", "agressor", "==", "par1EntityLiving", ")", "{", "villageagressor", ".", "agressionTime", "=", "tickCounter", ";", "return", ";", "}", "}", "villageAgressors", ".", "add", "(", "new", "VillageAgressor", "(", "this", ",", "par1EntityLiving", ",", "tickCounter", ")", ")", ";", "}", "public", "EntityLiving", "findNearestVillageAggressor", "(", "EntityLiving", "par1EntityLiving", ")", "{", "double", "d", "=", "Double", ".", "MAX_VALUE", ";", "VillageAgressor", "villageagressor", "=", "null", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "villageAgressors", ".", "size", "(", ")", ";", "i", "++", ")", "{", "VillageAgressor", "villageagressor1", "=", "(", "VillageAgressor", ")", "villageAgressors", ".", "get", "(", "i", ")", ";", "double", "d1", "=", "villageagressor1", ".", "agressor", ".", "getDistanceSqToEntity", "(", "par1EntityLiving", ")", ";", "if", "(", "d1", "<=", "d", ")", "{", "villageagressor", "=", "villageagressor1", ";", "d", "=", "d1", ";", "}", "}", "return", "villageagressor", "==", "null", "?", "null", ":", "villageagressor", ".", "agressor", ";", "}", "private", "void", "removeDeadAndOldAgressors", "(", ")", "{", "Iterator", "iterator", "=", "villageAgressors", ".", "iterator", "(", ")", ";", "do", "{", "if", "(", "!", "iterator", ".", "hasNext", "(", ")", ")", "{", "break", ";", "}", "VillageAgressor", "villageagressor", "=", "(", "VillageAgressor", ")", "iterator", ".", "next", "(", ")", ";", "if", "(", "!", "villageagressor", ".", "agressor", ".", "isEntityAlive", "(", ")", "||", "Math", ".", "abs", "(", "tickCounter", "-", "villageagressor", ".", "agressionTime", ")", ">", "300", ")", "{", "iterator", ".", "remove", "(", ")", ";", "}", "}", "while", "(", "true", ")", ";", "}", "private", "void", "removeDeadAndOutOfRangeDoors", "(", ")", "{", "boolean", "flag", "=", "false", ";", "boolean", "flag1", "=", "worldObj", ".", "rand", ".", "nextInt", "(", "50", ")", "==", "0", ";", "Iterator", "iterator", "=", "villageDoorInfoList", ".", "iterator", "(", ")", ";", "do", "{", "if", "(", "!", "iterator", ".", "hasNext", "(", ")", ")", "{", "break", ";", "}", "VillageDoorInfo", "villagedoorinfo", "=", "(", "VillageDoorInfo", ")", "iterator", ".", "next", "(", ")", ";", "if", "(", "flag1", ")", "{", "villagedoorinfo", ".", "resetDoorOpeningRestrictionCounter", "(", ")", ";", "}", "if", "(", "!", "isBlockDoor", "(", "villagedoorinfo", ".", "posX", ",", "villagedoorinfo", ".", "posY", ",", "villagedoorinfo", ".", "posZ", ")", "||", "Math", ".", "abs", "(", "tickCounter", "-", "villagedoorinfo", ".", "lastActivityTimestamp", ")", ">", "1200", ")", "{", "centerHelper", ".", "posX", "-=", "villagedoorinfo", ".", "posX", ";", "centerHelper", ".", "posY", "-=", "villagedoorinfo", ".", "posY", ";", "centerHelper", ".", "posZ", "-=", "villagedoorinfo", ".", "posZ", ";", "flag", "=", "true", ";", "villagedoorinfo", ".", "isDetachedFromVillageFlag", "=", "true", ";", "iterator", ".", "remove", "(", ")", ";", "}", "}", "while", "(", "true", ")", ";", "if", "(", "flag", ")", "{", "updateVillageRadiusAndCenter", "(", ")", ";", "}", "}", "private", "boolean", "isBlockDoor", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "int", "i", "=", "worldObj", ".", "getBlockId", "(", "par1", ",", "par2", ",", "par3", ")", ";", "if", "(", "i", "<=", "0", ")", "{", "return", "false", ";", "}", "else", "{", "return", "i", "==", "Block", ".", "doorWood", ".", "blockID", ";", "}", "}", "private", "void", "updateVillageRadiusAndCenter", "(", ")", "{", "int", "i", "=", "villageDoorInfoList", ".", "size", "(", ")", ";", "if", "(", "i", "==", "0", ")", "{", "center", ".", "set", "(", "0", ",", "0", ",", "0", ")", ";", "villageRadius", "=", "0", ";", "return", ";", "}", "center", ".", "set", "(", "centerHelper", ".", "posX", "/", "i", ",", "centerHelper", ".", "posY", "/", "i", ",", "centerHelper", ".", "posZ", "/", "i", ")", ";", "int", "j", "=", "0", ";", "for", "(", "Iterator", "iterator", "=", "villageDoorInfoList", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", ")", "{", "VillageDoorInfo", "villagedoorinfo", "=", "(", "VillageDoorInfo", ")", "iterator", ".", "next", "(", ")", ";", "j", "=", "Math", ".", "max", "(", "villagedoorinfo", ".", "getDistanceSquared", "(", "center", ".", "posX", ",", "center", ".", "posY", ",", "center", ".", "posZ", ")", ",", "j", ")", ";", "}", "villageRadius", "=", "Math", ".", "max", "(", "32", ",", "(", "int", ")", "Math", ".", "sqrt", "(", "j", ")", "+", "1", ")", ";", "}", "}", "</s>" ]
9,917
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "GenLayerIsland", "extends", "GenLayer", "{", "public", "GenLayerIsland", "(", "long", "par1", ")", "{", "super", "(", "par1", ")", ";", "}", "public", "int", "[", "]", "getInts", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "int", "ai", "[", "]", "=", "IntCache", ".", "getIntCache", "(", "par3", "*", "par4", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "par4", ";", "i", "++", ")", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<", "par3", ";", "j", "++", ")", "{", "initChunkSeed", "(", "par1", "+", "j", ",", "par2", "+", "i", ")", ";", "ai", "[", "j", "+", "i", "*", "par3", "]", "=", "nextInt", "(", "10", ")", "!=", "0", "?", "0", ":", "1", ";", "}", "}", "if", "(", "par1", ">", "-", "par3", "&&", "par1", "<=", "0", "&&", "par2", ">", "-", "par4", "&&", "par2", "<=", "0", ")", "{", "ai", "[", "-", "par1", "+", "-", "par2", "*", "par3", "]", "=", "1", ";", "}", "return", "ai", ";", "}", "}", "</s>" ]
9,918
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "io", ".", "BufferedReader", ";", "import", "java", ".", "io", ".", "InputStreamReader", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "public", "class", "AchievementMap", "{", "public", "static", "AchievementMap", "instance", "=", "new", "AchievementMap", "(", ")", ";", "private", "Map", "guidMap", ";", "private", "AchievementMap", "(", ")", "{", "guidMap", "=", "new", "HashMap", "(", ")", ";", "try", "{", "BufferedReader", "bufferedreader", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "(", "net", ".", "minecraft", ".", "src", ".", "AchievementMap", ".", "class", ")", ".", "getResourceAsStream", "(", "\"\"", ")", ")", ")", ";", "String", "s", ";", "while", "(", "(", "s", "=", "bufferedreader", ".", "readLine", "(", ")", ")", "!=", "null", ")", "{", "String", "as", "[", "]", "=", "s", ".", "split", "(", "\",\"", ")", ";", "int", "i", "=", "Integer", ".", "parseInt", "(", "as", "[", "0", "]", ")", ";", "guidMap", ".", "put", "(", "Integer", ".", "valueOf", "(", "i", ")", ",", "as", "[", "1", "]", ")", ";", "}", "bufferedreader", ".", "close", "(", ")", ";", "}", "catch", "(", "Exception", "exception", ")", "{", "exception", ".", "printStackTrace", "(", ")", ";", "}", "}", "public", "static", "String", "getGuid", "(", "int", "par0", ")", "{", "return", "(", "String", ")", "instance", ".", "guidMap", ".", "get", "(", "Integer", ".", "valueOf", "(", "par0", ")", ")", ";", "}", "}", "</s>" ]
9,919
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "List", ";", "public", "class", "AxisAlignedBB", "{", "private", "static", "List", "boundingBoxes", "=", "new", "ArrayList", "(", ")", ";", "private", "static", "int", "numBoundingBoxesInUse", "=", "0", ";", "public", "double", "minX", ";", "public", "double", "minY", ";", "public", "double", "minZ", ";", "public", "double", "maxX", ";", "public", "double", "maxY", ";", "public", "double", "maxZ", ";", "public", "static", "AxisAlignedBB", "getBoundingBox", "(", "double", "par0", ",", "double", "par2", ",", "double", "par4", ",", "double", "par6", ",", "double", "par8", ",", "double", "par10", ")", "{", "return", "new", "AxisAlignedBB", "(", "par0", ",", "par2", ",", "par4", ",", "par6", ",", "par8", ",", "par10", ")", ";", "}", "public", "static", "void", "clearBoundingBoxPool", "(", ")", "{", "numBoundingBoxesInUse", "=", "0", ";", "}", "public", "static", "AxisAlignedBB", "getBoundingBoxFromPool", "(", "double", "par0", ",", "double", "par2", ",", "double", "par4", ",", "double", "par6", ",", "double", "par8", ",", "double", "par10", ")", "{", "if", "(", "numBoundingBoxesInUse", ">=", "boundingBoxes", ".", "size", "(", ")", ")", "{", "boundingBoxes", ".", "add", "(", "getBoundingBox", "(", "0.0D", ",", "0.0D", ",", "0.0D", ",", "0.0D", ",", "0.0D", ",", "0.0D", ")", ")", ";", "}", "return", "(", "(", "AxisAlignedBB", ")", "boundingBoxes", ".", "get", "(", "numBoundingBoxesInUse", "++", ")", ")", ".", "setBounds", "(", "par0", ",", "par2", ",", "par4", ",", "par6", ",", "par8", ",", "par10", ")", ";", "}", "private", "AxisAlignedBB", "(", "double", "par1", ",", "double", "par3", ",", "double", "par5", ",", "double", "par7", ",", "double", "par9", ",", "double", "par11", ")", "{", "minX", "=", "par1", ";", "minY", "=", "par3", ";", "minZ", "=", "par5", ";", "maxX", "=", "par7", ";", "maxY", "=", "par9", ";", "maxZ", "=", "par11", ";", "}", "public", "AxisAlignedBB", "setBounds", "(", "double", "par1", ",", "double", "par3", ",", "double", "par5", ",", "double", "par7", ",", "double", "par9", ",", "double", "par11", ")", "{", "minX", "=", "par1", ";", "minY", "=", "par3", ";", "minZ", "=", "par5", ";", "maxX", "=", "par7", ";", "maxY", "=", "par9", ";", "maxZ", "=", "par11", ";", "return", "this", ";", "}", "public", "AxisAlignedBB", "addCoord", "(", "double", "par1", ",", "double", "par3", ",", "double", "par5", ")", "{", "double", "d", "=", "minX", ";", "double", "d1", "=", "minY", ";", "double", "d2", "=", "minZ", ";", "double", "d3", "=", "maxX", ";", "double", "d4", "=", "maxY", ";", "double", "d5", "=", "maxZ", ";", "if", "(", "par1", "<", "0.0D", ")", "{", "d", "+=", "par1", ";", "}", "if", "(", "par1", ">", "0.0D", ")", "{", "d3", "+=", "par1", ";", "}", "if", "(", "par3", "<", "0.0D", ")", "{", "d1", "+=", "par3", ";", "}", "if", "(", "par3", ">", "0.0D", ")", "{", "d4", "+=", "par3", ";", "}", "if", "(", "par5", "<", "0.0D", ")", "{", "d2", "+=", "par5", ";", "}", "if", "(", "par5", ">", "0.0D", ")", "{", "d5", "+=", "par5", ";", "}", "return", "getBoundingBoxFromPool", "(", "d", ",", "d1", ",", "d2", ",", "d3", ",", "d4", ",", "d5", ")", ";", "}", "public", "AxisAlignedBB", "expand", "(", "double", "par1", ",", "double", "par3", ",", "double", "par5", ")", "{", "double", "d", "=", "minX", "-", "par1", ";", "double", "d1", "=", "minY", "-", "par3", ";", "double", "d2", "=", "minZ", "-", "par5", ";", "double", "d3", "=", "maxX", "+", "par1", ";", "double", "d4", "=", "maxY", "+", "par3", ";", "double", "d5", "=", "maxZ", "+", "par5", ";", "return", "getBoundingBoxFromPool", "(", "d", ",", "d1", ",", "d2", ",", "d3", ",", "d4", ",", "d5", ")", ";", "}", "public", "AxisAlignedBB", "getOffsetBoundingBox", "(", "double", "par1", ",", "double", "par3", ",", "double", "par5", ")", "{", "return", "getBoundingBoxFromPool", "(", "minX", "+", "par1", ",", "minY", "+", "par3", ",", "minZ", "+", "par5", ",", "maxX", "+", "par1", ",", "maxY", "+", "par3", ",", "maxZ", "+", "par5", ")", ";", "}", "public", "double", "calculateXOffset", "(", "AxisAlignedBB", "par1AxisAlignedBB", ",", "double", "par2", ")", "{", "if", "(", "par1AxisAlignedBB", ".", "maxY", "<=", "minY", "||", "par1AxisAlignedBB", ".", "minY", ">=", "maxY", ")", "{", "return", "par2", ";", "}", "if", "(", "par1AxisAlignedBB", ".", "maxZ", "<=", "minZ", "||", "par1AxisAlignedBB", ".", "minZ", ">=", "maxZ", ")", "{", "return", "par2", ";", "}", "if", "(", "par2", ">", "0.0D", "&&", "par1AxisAlignedBB", ".", "maxX", "<=", "minX", ")", "{", "double", "d", "=", "minX", "-", "par1AxisAlignedBB", ".", "maxX", ";", "if", "(", "d", "<", "par2", ")", "{", "par2", "=", "d", ";", "}", "}", "if", "(", "par2", "<", "0.0D", "&&", "par1AxisAlignedBB", ".", "minX", ">=", "maxX", ")", "{", "double", "d1", "=", "maxX", "-", "par1AxisAlignedBB", ".", "minX", ";", "if", "(", "d1", ">", "par2", ")", "{", "par2", "=", "d1", ";", "}", "}", "return", "par2", ";", "}", "public", "double", "calculateYOffset", "(", "AxisAlignedBB", "par1AxisAlignedBB", ",", "double", "par2", ")", "{", "if", "(", "par1AxisAlignedBB", ".", "maxX", "<=", "minX", "||", "par1AxisAlignedBB", ".", "minX", ">=", "maxX", ")", "{", "return", "par2", ";", "}", "if", "(", "par1AxisAlignedBB", ".", "maxZ", "<=", "minZ", "||", "par1AxisAlignedBB", ".", "minZ", ">=", "maxZ", ")", "{", "return", "par2", ";", "}", "if", "(", "par2", ">", "0.0D", "&&", "par1AxisAlignedBB", ".", "maxY", "<=", "minY", ")", "{", "double", "d", "=", "minY", "-", "par1AxisAlignedBB", ".", "maxY", ";", "if", "(", "d", "<", "par2", ")", "{", "par2", "=", "d", ";", "}", "}", "if", "(", "par2", "<", "0.0D", "&&", "par1AxisAlignedBB", ".", "minY", ">=", "maxY", ")", "{", "double", "d1", "=", "maxY", "-", "par1AxisAlignedBB", ".", "minY", ";", "if", "(", "d1", ">", "par2", ")", "{", "par2", "=", "d1", ";", "}", "}", "return", "par2", ";", "}", "public", "double", "calculateZOffset", "(", "AxisAlignedBB", "par1AxisAlignedBB", ",", "double", "par2", ")", "{", "if", "(", "par1AxisAlignedBB", ".", "maxX", "<=", "minX", "||", "par1AxisAlignedBB", ".", "minX", ">=", "maxX", ")", "{", "return", "par2", ";", "}", "if", "(", "par1AxisAlignedBB", ".", "maxY", "<=", "minY", "||", "par1AxisAlignedBB", ".", "minY", ">=", "maxY", ")", "{", "return", "par2", ";", "}", "if", "(", "par2", ">", "0.0D", "&&", "par1AxisAlignedBB", ".", "maxZ", "<=", "minZ", ")", "{", "double", "d", "=", "minZ", "-", "par1AxisAlignedBB", ".", "maxZ", ";", "if", "(", "d", "<", "par2", ")", "{", "par2", "=", "d", ";", "}", "}", "if", "(", "par2", "<", "0.0D", "&&", "par1AxisAlignedBB", ".", "minZ", ">=", "maxZ", ")", "{", "double", "d1", "=", "maxZ", "-", "par1AxisAlignedBB", ".", "minZ", ";", "if", "(", "d1", ">", "par2", ")", "{", "par2", "=", "d1", ";", "}", "}", "return", "par2", ";", "}", "public", "boolean", "intersectsWith", "(", "AxisAlignedBB", "par1AxisAlignedBB", ")", "{", "if", "(", "par1AxisAlignedBB", ".", "maxX", "<=", "minX", "||", "par1AxisAlignedBB", ".", "minX", ">=", "maxX", ")", "{", "return", "false", ";", "}", "if", "(", "par1AxisAlignedBB", ".", "maxY", "<=", "minY", "||", "par1AxisAlignedBB", ".", "minY", ">=", "maxY", ")", "{", "return", "false", ";", "}", "return", "par1AxisAlignedBB", ".", "maxZ", ">", "minZ", "&&", "par1AxisAlignedBB", ".", "minZ", "<", "maxZ", ";", "}", "public", "AxisAlignedBB", "offset", "(", "double", "par1", ",", "double", "par3", ",", "double", "par5", ")", "{", "minX", "+=", "par1", ";", "minY", "+=", "par3", ";", "minZ", "+=", "par5", ";", "maxX", "+=", "par1", ";", "maxY", "+=", "par3", ";", "maxZ", "+=", "par5", ";", "return", "this", ";", "}", "public", "boolean", "isVecInside", "(", "Vec3D", "par1Vec3D", ")", "{", "if", "(", "par1Vec3D", ".", "xCoord", "<=", "minX", "||", "par1Vec3D", ".", "xCoord", ">=", "maxX", ")", "{", "return", "false", ";", "}", "if", "(", "par1Vec3D", ".", "yCoord", "<=", "minY", "||", "par1Vec3D", ".", "yCoord", ">=", "maxY", ")", "{", "return", "false", ";", "}", "return", "par1Vec3D", ".", "zCoord", ">", "minZ", "&&", "par1Vec3D", ".", "zCoord", "<", "maxZ", ";", "}", "public", "AxisAlignedBB", "contract", "(", "double", "par1", ",", "double", "par3", ",", "double", "par5", ")", "{", "double", "d", "=", "minX", "+", "par1", ";", "double", "d1", "=", "minY", "+", "par3", ";", "double", "d2", "=", "minZ", "+", "par5", ";", "double", "d3", "=", "maxX", "-", "par1", ";", "double", "d4", "=", "maxY", "-", "par3", ";", "double", "d5", "=", "maxZ", "-", "par5", ";", "return", "getBoundingBoxFromPool", "(", "d", ",", "d1", ",", "d2", ",", "d3", ",", "d4", ",", "d5", ")", ";", "}", "public", "AxisAlignedBB", "copy", "(", ")", "{", "return", "getBoundingBoxFromPool", "(", "minX", ",", "minY", ",", "minZ", ",", "maxX", ",", "maxY", ",", "maxZ", ")", ";", "}", "public", "MovingObjectPosition", "calculateIntercept", "(", "Vec3D", "par1Vec3D", ",", "Vec3D", "par2Vec3D", ")", "{", "Vec3D", "vec3d", "=", "par1Vec3D", ".", "getIntermediateWithXValue", "(", "par2Vec3D", ",", "minX", ")", ";", "Vec3D", "vec3d1", "=", "par1Vec3D", ".", "getIntermediateWithXValue", "(", "par2Vec3D", ",", "maxX", ")", ";", "Vec3D", "vec3d2", "=", "par1Vec3D", ".", "getIntermediateWithYValue", "(", "par2Vec3D", ",", "minY", ")", ";", "Vec3D", "vec3d3", "=", "par1Vec3D", ".", "getIntermediateWithYValue", "(", "par2Vec3D", ",", "maxY", ")", ";", "Vec3D", "vec3d4", "=", "par1Vec3D", ".", "getIntermediateWithZValue", "(", "par2Vec3D", ",", "minZ", ")", ";", "Vec3D", "vec3d5", "=", "par1Vec3D", ".", "getIntermediateWithZValue", "(", "par2Vec3D", ",", "maxZ", ")", ";", "if", "(", "!", "isVecInYZ", "(", "vec3d", ")", ")", "{", "vec3d", "=", "null", ";", "}", "if", "(", "!", "isVecInYZ", "(", "vec3d1", ")", ")", "{", "vec3d1", "=", "null", ";", "}", "if", "(", "!", "isVecInXZ", "(", "vec3d2", ")", ")", "{", "vec3d2", "=", "null", ";", "}", "if", "(", "!", "isVecInXZ", "(", "vec3d3", ")", ")", "{", "vec3d3", "=", "null", ";", "}", "if", "(", "!", "isVecInXY", "(", "vec3d4", ")", ")", "{", "vec3d4", "=", "null", ";", "}", "if", "(", "!", "isVecInXY", "(", "vec3d5", ")", ")", "{", "vec3d5", "=", "null", ";", "}", "Vec3D", "vec3d6", "=", "null", ";", "if", "(", "vec3d", "!=", "null", "&&", "(", "vec3d6", "==", "null", "||", "par1Vec3D", ".", "squareDistanceTo", "(", "vec3d", ")", "<", "par1Vec3D", ".", "squareDistanceTo", "(", "vec3d6", ")", ")", ")", "{", "vec3d6", "=", "vec3d", ";", "}", "if", "(", "vec3d1", "!=", "null", "&&", "(", "vec3d6", "==", "null", "||", "par1Vec3D", ".", "squareDistanceTo", "(", "vec3d1", ")", "<", "par1Vec3D", ".", "squareDistanceTo", "(", "vec3d6", ")", ")", ")", "{", "vec3d6", "=", "vec3d1", ";", "}", "if", "(", "vec3d2", "!=", "null", "&&", "(", "vec3d6", "==", "null", "||", "par1Vec3D", ".", "squareDistanceTo", "(", "vec3d2", ")", "<", "par1Vec3D", ".", "squareDistanceTo", "(", "vec3d6", ")", ")", ")", "{", "vec3d6", "=", "vec3d2", ";", "}", "if", "(", "vec3d3", "!=", "null", "&&", "(", "vec3d6", "==", "null", "||", "par1Vec3D", ".", "squareDistanceTo", "(", "vec3d3", ")", "<", "par1Vec3D", ".", "squareDistanceTo", "(", "vec3d6", ")", ")", ")", "{", "vec3d6", "=", "vec3d3", ";", "}", "if", "(", "vec3d4", "!=", "null", "&&", "(", "vec3d6", "==", "null", "||", "par1Vec3D", ".", "squareDistanceTo", "(", "vec3d4", ")", "<", "par1Vec3D", ".", "squareDistanceTo", "(", "vec3d6", ")", ")", ")", "{", "vec3d6", "=", "vec3d4", ";", "}", "if", "(", "vec3d5", "!=", "null", "&&", "(", "vec3d6", "==", "null", "||", "par1Vec3D", ".", "squareDistanceTo", "(", "vec3d5", ")", "<", "par1Vec3D", ".", "squareDistanceTo", "(", "vec3d6", ")", ")", ")", "{", "vec3d6", "=", "vec3d5", ";", "}", "if", "(", "vec3d6", "==", "null", ")", "{", "return", "null", ";", "}", "byte", "byte0", "=", "-", "1", ";", "if", "(", "vec3d6", "==", "vec3d", ")", "{", "byte0", "=", "4", ";", "}", "if", "(", "vec3d6", "==", "vec3d1", ")", "{", "byte0", "=", "5", ";", "}", "if", "(", "vec3d6", "==", "vec3d2", ")", "{", "byte0", "=", "0", ";", "}", "if", "(", "vec3d6", "==", "vec3d3", ")", "{", "byte0", "=", "1", ";", "}", "if", "(", "vec3d6", "==", "vec3d4", ")", "{", "byte0", "=", "2", ";", "}", "if", "(", "vec3d6", "==", "vec3d5", ")", "{", "byte0", "=", "3", ";", "}", "return", "new", "MovingObjectPosition", "(", "0", ",", "0", ",", "0", ",", "byte0", ",", "vec3d6", ")", ";", "}", "private", "boolean", "isVecInYZ", "(", "Vec3D", "par1Vec3D", ")", "{", "if", "(", "par1Vec3D", "==", "null", ")", "{", "return", "false", ";", "}", "else", "{", "return", "par1Vec3D", ".", "yCoord", ">=", "minY", "&&", "par1Vec3D", ".", "yCoord", "<=", "maxY", "&&", "par1Vec3D", ".", "zCoord", ">=", "minZ", "&&", "par1Vec3D", ".", "zCoord", "<=", "maxZ", ";", "}", "}", "private", "boolean", "isVecInXZ", "(", "Vec3D", "par1Vec3D", ")", "{", "if", "(", "par1Vec3D", "==", "null", ")", "{", "return", "false", ";", "}", "else", "{", "return", "par1Vec3D", ".", "xCoord", ">=", "minX", "&&", "par1Vec3D", ".", "xCoord", "<=", "maxX", "&&", "par1Vec3D", ".", "zCoord", ">=", "minZ", "&&", "par1Vec3D", ".", "zCoord", "<=", "maxZ", ";", "}", "}", "private", "boolean", "isVecInXY", "(", "Vec3D", "par1Vec3D", ")", "{", "if", "(", "par1Vec3D", "==", "null", ")", "{", "return", "false", ";", "}", "else", "{", "return", "par1Vec3D", ".", "xCoord", ">=", "minX", "&&", "par1Vec3D", ".", "xCoord", "<=", "maxX", "&&", "par1Vec3D", ".", "yCoord", ">=", "minY", "&&", "par1Vec3D", ".", "yCoord", "<=", "maxY", ";", "}", "}", "public", "void", "setBB", "(", "AxisAlignedBB", "par1AxisAlignedBB", ")", "{", "minX", "=", "par1AxisAlignedBB", ".", "minX", ";", "minY", "=", "par1AxisAlignedBB", ".", "minY", ";", "minZ", "=", "par1AxisAlignedBB", ".", "minZ", ";", "maxX", "=", "par1AxisAlignedBB", ".", "maxX", ";", "maxY", "=", "par1AxisAlignedBB", ".", "maxY", ";", "maxZ", "=", "par1AxisAlignedBB", ".", "maxZ", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "(", "new", "StringBuilder", "(", ")", ")", ".", "append", "(", "\"box[\"", ")", ".", "append", "(", "minX", ")", ".", "append", "(", "\",", "\"", ")", ".", "append", "(", "minY", ")", ".", "append", "(", "\",", "\"", ")", ".", "append", "(", "minZ", ")", ".", "append", "(", "\"", "->", "\"", ")", ".", "append", "(", "maxX", ")", ".", "append", "(", "\",", "\"", ")", ".", "append", "(", "maxY", ")", ".", "append", "(", "\",", "\"", ")", ".", "append", "(", "maxZ", ")", ".", "append", "(", "\"]\"", ")", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
9,920
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "EntityPainting", "extends", "Entity", "{", "private", "int", "tickCounter1", ";", "public", "int", "direction", ";", "public", "int", "xPosition", ";", "public", "int", "yPosition", ";", "public", "int", "zPosition", ";", "public", "EnumArt", "art", ";", "public", "EntityPainting", "(", "World", "par1World", ")", "{", "super", "(", "par1World", ")", ";", "tickCounter1", "=", "0", ";", "direction", "=", "0", ";", "yOffset", "=", "0.0F", ";", "setSize", "(", "0.5F", ",", "0.5F", ")", ";", "}", "public", "EntityPainting", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "int", "par5", ")", "{", "this", "(", "par1World", ")", ";", "xPosition", "=", "par2", ";", "yPosition", "=", "par3", ";", "zPosition", "=", "par4", ";", "ArrayList", "arraylist", "=", "new", "ArrayList", "(", ")", ";", "EnumArt", "aenumart", "[", "]", "=", "EnumArt", ".", "values", "(", ")", ";", "int", "i", "=", "aenumart", ".", "length", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "i", ";", "j", "++", ")", "{", "EnumArt", "enumart", "=", "aenumart", "[", "j", "]", ";", "art", "=", "enumart", ";", "func_179_a", "(", "par5", ")", ";", "if", "(", "onValidSurface", "(", ")", ")", "{", "arraylist", ".", "add", "(", "enumart", ")", ";", "}", "}", "if", "(", "arraylist", ".", "size", "(", ")", ">", "0", ")", "{", "art", "=", "(", "EnumArt", ")", "arraylist", ".", "get", "(", "rand", ".", "nextInt", "(", "arraylist", ".", "size", "(", ")", ")", ")", ";", "}", "func_179_a", "(", "par5", ")", ";", "}", "protected", "void", "entityInit", "(", ")", "{", "}", "public", "void", "func_179_a", "(", "int", "par1", ")", "{", "direction", "=", "par1", ";", "prevRotationYaw", "=", "rotationYaw", "=", "par1", "*", "90", ";", "float", "f", "=", "art", ".", "sizeX", ";", "float", "f1", "=", "art", ".", "sizeY", ";", "float", "f2", "=", "art", ".", "sizeX", ";", "if", "(", "par1", "==", "0", "||", "par1", "==", "2", ")", "{", "f2", "=", "0.5F", ";", "}", "else", "{", "f", "=", "0.5F", ";", "}", "f", "/=", "32F", ";", "f1", "/=", "32F", ";", "f2", "/=", "32F", ";", "float", "f3", "=", "(", "float", ")", "xPosition", "+", "0.5F", ";", "float", "f4", "=", "(", "float", ")", "yPosition", "+", "0.5F", ";", "float", "f5", "=", "(", "float", ")", "zPosition", "+", "0.5F", ";", "float", "f6", "=", "0.5625F", ";", "if", "(", "par1", "==", "0", ")", "{", "f5", "-=", "f6", ";", "}", "if", "(", "par1", "==", "1", ")", "{", "f3", "-=", "f6", ";", "}", "if", "(", "par1", "==", "2", ")", "{", "f5", "+=", "f6", ";", "}", "if", "(", "par1", "==", "3", ")", "{", "f3", "+=", "f6", ";", "}", "if", "(", "par1", "==", "0", ")", "{", "f3", "-=", "func_180_c", "(", "art", ".", "sizeX", ")", ";", "}", "if", "(", "par1", "==", "1", ")", "{", "f5", "+=", "func_180_c", "(", "art", ".", "sizeX", ")", ";", "}", "if", "(", "par1", "==", "2", ")", "{", "f3", "+=", "func_180_c", "(", "art", ".", "sizeX", ")", ";", "}", "if", "(", "par1", "==", "3", ")", "{", "f5", "-=", "func_180_c", "(", "art", ".", "sizeX", ")", ";", "}", "f4", "+=", "func_180_c", "(", "art", ".", "sizeY", ")", ";", "setPosition", "(", "f3", ",", "f4", ",", "f5", ")", ";", "float", "f7", "=", "-", "0.00625F", ";", "boundingBox", ".", "setBounds", "(", "f3", "-", "f", "-", "f7", ",", "f4", "-", "f1", "-", "f7", ",", "f5", "-", "f2", "-", "f7", ",", "f3", "+", "f", "+", "f7", ",", "f4", "+", "f1", "+", "f7", ",", "f5", "+", "f2", "+", "f7", ")", ";", "}", "private", "float", "func_180_c", "(", "int", "par1", ")", "{", "if", "(", "par1", "==", "32", ")", "{", "return", "0.5F", ";", "}", "return", "par1", "!=", "64", "?", "0.0F", ":", "0.5F", ";", "}", "public", "void", "onUpdate", "(", ")", "{", "if", "(", "tickCounter1", "++", "==", "100", "&&", "!", "worldObj", ".", "isRemote", ")", "{", "tickCounter1", "=", "0", ";", "if", "(", "!", "isDead", "&&", "!", "onValidSurface", "(", ")", ")", "{", "setDead", "(", ")", ";", "worldObj", ".", "spawnEntityInWorld", "(", "new", "EntityItem", "(", "worldObj", ",", "posX", ",", "posY", ",", "posZ", ",", "new", "ItemStack", "(", "Item", ".", "painting", ")", ")", ")", ";", "}", "}", "}", "public", "boolean", "onValidSurface", "(", ")", "{", "if", "(", "worldObj", ".", "getCollidingBoundingBoxes", "(", "this", ",", "boundingBox", ")", ".", "size", "(", ")", ">", "0", ")", "{", "return", "false", ";", "}", "int", "i", "=", "art", ".", "sizeX", "/", "16", ";", "int", "j", "=", "art", ".", "sizeY", "/", "16", ";", "int", "k", "=", "xPosition", ";", "int", "l", "=", "yPosition", ";", "int", "i1", "=", "zPosition", ";", "if", "(", "direction", "==", "0", ")", "{", "k", "=", "MathHelper", ".", "floor_double", "(", "posX", "-", "(", "double", ")", "(", "(", "float", ")", "art", ".", "sizeX", "/", "32F", ")", ")", ";", "}", "if", "(", "direction", "==", "1", ")", "{", "i1", "=", "MathHelper", ".", "floor_double", "(", "posZ", "-", "(", "double", ")", "(", "(", "float", ")", "art", ".", "sizeX", "/", "32F", ")", ")", ";", "}", "if", "(", "direction", "==", "2", ")", "{", "k", "=", "MathHelper", ".", "floor_double", "(", "posX", "-", "(", "double", ")", "(", "(", "float", ")", "art", ".", "sizeX", "/", "32F", ")", ")", ";", "}", "if", "(", "direction", "==", "3", ")", "{", "i1", "=", "MathHelper", ".", "floor_double", "(", "posZ", "-", "(", "double", ")", "(", "(", "float", ")", "art", ".", "sizeX", "/", "32F", ")", ")", ";", "}", "l", "=", "MathHelper", ".", "floor_double", "(", "posY", "-", "(", "double", ")", "(", "(", "float", ")", "art", ".", "sizeY", "/", "32F", ")", ")", ";", "for", "(", "int", "j1", "=", "0", ";", "j1", "<", "i", ";", "j1", "++", ")", "{", "for", "(", "int", "k1", "=", "0", ";", "k1", "<", "j", ";", "k1", "++", ")", "{", "Material", "material", ";", "if", "(", "direction", "==", "0", "||", "direction", "==", "2", ")", "{", "material", "=", "worldObj", ".", "getBlockMaterial", "(", "k", "+", "j1", ",", "l", "+", "k1", ",", "zPosition", ")", ";", "}", "else", "{", "material", "=", "worldObj", ".", "getBlockMaterial", "(", "xPosition", ",", "l", "+", "k1", ",", "i1", "+", "j1", ")", ";", "}", "if", "(", "!", "material", ".", "isSolid", "(", ")", ")", "{", "return", "false", ";", "}", "}", "}", "List", "list", "=", "worldObj", ".", "getEntitiesWithinAABBExcludingEntity", "(", "this", ",", "boundingBox", ")", ";", "for", "(", "int", "l1", "=", "0", ";", "l1", "<", "list", ".", "size", "(", ")", ";", "l1", "++", ")", "{", "if", "(", "list", ".", "get", "(", "l1", ")", "instanceof", "EntityPainting", ")", "{", "return", "false", ";", "}", "}", "return", "true", ";", "}", "public", "boolean", "canBeCollidedWith", "(", ")", "{", "return", "true", ";", "}", "public", "boolean", "attackEntityFrom", "(", "DamageSource", "par1DamageSource", ",", "int", "par2", ")", "{", "if", "(", "!", "isDead", "&&", "!", "worldObj", ".", "isRemote", ")", "{", "setDead", "(", ")", ";", "setBeenAttacked", "(", ")", ";", "worldObj", ".", "spawnEntityInWorld", "(", "new", "EntityItem", "(", "worldObj", ",", "posX", ",", "posY", ",", "posZ", ",", "new", "ItemStack", "(", "Item", ".", "painting", ")", ")", ")", ";", "}", "return", "true", ";", "}", "public", "void", "writeEntityToNBT", "(", "NBTTagCompound", "par1NBTTagCompound", ")", "{", "par1NBTTagCompound", ".", "setByte", "(", "\"Dir\"", ",", "(", "byte", ")", "direction", ")", ";", "par1NBTTagCompound", ".", "setString", "(", "\"Motive\"", ",", "art", ".", "title", ")", ";", "par1NBTTagCompound", ".", "setInteger", "(", "\"TileX\"", ",", "xPosition", ")", ";", "par1NBTTagCompound", ".", "setInteger", "(", "\"TileY\"", ",", "yPosition", ")", ";", "par1NBTTagCompound", ".", "setInteger", "(", "\"TileZ\"", ",", "zPosition", ")", ";", "}", "public", "void", "readEntityFromNBT", "(", "NBTTagCompound", "par1NBTTagCompound", ")", "{", "direction", "=", "par1NBTTagCompound", ".", "getByte", "(", "\"Dir\"", ")", ";", "xPosition", "=", "par1NBTTagCompound", ".", "getInteger", "(", "\"TileX\"", ")", ";", "yPosition", "=", "par1NBTTagCompound", ".", "getInteger", "(", "\"TileY\"", ")", ";", "zPosition", "=", "par1NBTTagCompound", ".", "getInteger", "(", "\"TileZ\"", ")", ";", "String", "s", "=", "par1NBTTagCompound", ".", "getString", "(", "\"Motive\"", ")", ";", "EnumArt", "aenumart", "[", "]", "=", "EnumArt", ".", "values", "(", ")", ";", "int", "i", "=", "aenumart", ".", "length", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "i", ";", "j", "++", ")", "{", "EnumArt", "enumart", "=", "aenumart", "[", "j", "]", ";", "if", "(", "enumart", ".", "title", ".", "equals", "(", "s", ")", ")", "{", "art", "=", "enumart", ";", "}", "}", "if", "(", "art", "==", "null", ")", "{", "art", "=", "EnumArt", ".", "Kebab", ";", "}", "func_179_a", "(", "direction", ")", ";", "}", "public", "void", "moveEntity", "(", "double", "par1", ",", "double", "par3", ",", "double", "par5", ")", "{", "if", "(", "!", "worldObj", ".", "isRemote", "&&", "!", "isDead", "&&", "par1", "*", "par1", "+", "par3", "*", "par3", "+", "par5", "*", "par5", ">", "0.0D", ")", "{", "setDead", "(", ")", ";", "worldObj", ".", "spawnEntityInWorld", "(", "new", "EntityItem", "(", "worldObj", ",", "posX", ",", "posY", ",", "posZ", ",", "new", "ItemStack", "(", "Item", ".", "painting", ")", ")", ")", ";", "}", "}", "public", "void", "addVelocity", "(", "double", "par1", ",", "double", "par3", ",", "double", "par5", ")", "{", "if", "(", "!", "worldObj", ".", "isRemote", "&&", "!", "isDead", "&&", "par1", "*", "par1", "+", "par3", "*", "par3", "+", "par5", "*", "par5", ">", "0.0D", ")", "{", "setDead", "(", ")", ";", "worldObj", ".", "spawnEntityInWorld", "(", "new", "EntityItem", "(", "worldObj", ",", "posX", ",", "posY", ",", "posZ", ",", "new", "ItemStack", "(", "Item", ".", "painting", ")", ")", ")", ";", "}", "}", "}", "</s>" ]
9,921
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Random", ";", "public", "class", "ComponentNetherBridgeCorridor5", "extends", "ComponentNetherBridgePiece", "{", "public", "ComponentNetherBridgeCorridor5", "(", "int", "par1", ",", "Random", "par2Random", ",", "StructureBoundingBox", "par3StructureBoundingBox", ",", "int", "par4", ")", "{", "super", "(", "par1", ")", ";", "coordBaseMode", "=", "par4", ";", "boundingBox", "=", "par3StructureBoundingBox", ";", "}", "public", "void", "buildComponent", "(", "StructureComponent", "par1StructureComponent", ",", "List", "par2List", ",", "Random", "par3Random", ")", "{", "getNextComponentNormal", "(", "(", "ComponentNetherBridgeStartPiece", ")", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "1", ",", "0", ",", "true", ")", ";", "}", "public", "static", "ComponentNetherBridgeCorridor5", "createValidComponent", "(", "List", "par0List", ",", "Random", "par1Random", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "int", "par5", ",", "int", "par6", ")", "{", "StructureBoundingBox", "structureboundingbox", "=", "StructureBoundingBox", ".", "getComponentToAddBoundingBox", "(", "par2", ",", "par3", ",", "par4", ",", "-", "1", ",", "0", ",", "0", ",", "5", ",", "7", ",", "5", ",", "par5", ")", ";", "if", "(", "!", "isAboveGround", "(", "structureboundingbox", ")", "||", "StructureComponent", ".", "findIntersecting", "(", "par0List", ",", "structureboundingbox", ")", "!=", "null", ")", "{", "return", "null", ";", "}", "else", "{", "return", "new", "ComponentNetherBridgeCorridor5", "(", "par6", ",", "par1Random", ",", "structureboundingbox", ",", "par5", ")", ";", "}", "}", "public", "boolean", "addComponentParts", "(", "World", "par1World", ",", "Random", "par2Random", ",", "StructureBoundingBox", "par3StructureBoundingBox", ")", "{", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "0", ",", "0", ",", "0", ",", "4", ",", "1", ",", "4", ",", "Block", ".", "netherBrick", ".", "blockID", ",", "Block", ".", "netherBrick", ".", "blockID", ",", "false", ")", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "0", ",", "2", ",", "0", ",", "4", ",", "5", ",", "4", ",", "0", ",", "0", ",", "false", ")", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "0", ",", "2", ",", "0", ",", "0", ",", "5", ",", "4", ",", "Block", ".", "netherBrick", ".", "blockID", ",", "Block", ".", "netherBrick", ".", "blockID", ",", "false", ")", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "4", ",", "2", ",", "0", ",", "4", ",", "5", ",", "4", ",", "Block", ".", "netherBrick", ".", "blockID", ",", "Block", ".", "netherBrick", ".", "blockID", ",", "false", ")", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "0", ",", "3", ",", "1", ",", "0", ",", "4", ",", "1", ",", "Block", ".", "netherFence", ".", "blockID", ",", "Block", ".", "netherFence", ".", "blockID", ",", "false", ")", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "0", ",", "3", ",", "3", ",", "0", ",", "4", ",", "3", ",", "Block", ".", "netherFence", ".", "blockID", ",", "Block", ".", "netherFence", ".", "blockID", ",", "false", ")", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "4", ",", "3", ",", "1", ",", "4", ",", "4", ",", "1", ",", "Block", ".", "netherFence", ".", "blockID", ",", "Block", ".", "netherFence", ".", "blockID", ",", "false", ")", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "4", ",", "3", ",", "3", ",", "4", ",", "4", ",", "3", ",", "Block", ".", "netherFence", ".", "blockID", ",", "Block", ".", "netherFence", ".", "blockID", ",", "false", ")", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "0", ",", "6", ",", "0", ",", "4", ",", "6", ",", "4", ",", "Block", ".", "netherBrick", ".", "blockID", ",", "Block", ".", "netherBrick", ".", "blockID", ",", "false", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<=", "4", ";", "i", "++", ")", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<=", "4", ";", "j", "++", ")", "{", "fillCurrentPositionBlocksDownwards", "(", "par1World", ",", "Block", ".", "netherBrick", ".", "blockID", ",", "0", ",", "i", ",", "-", "1", ",", "j", ",", "par3StructureBoundingBox", ")", ";", "}", "}", "return", "true", ";", "}", "}", "</s>" ]
9,922
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "io", ".", "PrintStream", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "Chunk", "{", "public", "static", "boolean", "isLit", ";", "private", "ExtendedBlockStorage", "storageArrays", "[", "]", ";", "private", "byte", "blockBiomeArray", "[", "]", ";", "public", "int", "precipitationHeightMap", "[", "]", ";", "public", "boolean", "updateSkylightColumns", "[", "]", ";", "public", "boolean", "isChunkLoaded", ";", "public", "World", "worldObj", ";", "public", "int", "heightMap", "[", "]", ";", "public", "final", "int", "xPosition", ";", "public", "final", "int", "zPosition", ";", "private", "boolean", "isGapLightingUpdated", ";", "public", "Map", "chunkTileEntityMap", ";", "public", "List", "entityLists", "[", "]", ";", "public", "boolean", "isTerrainPopulated", ";", "public", "boolean", "isModified", ";", "public", "boolean", "hasEntities", ";", "public", "long", "lastSaveTime", ";", "public", "boolean", "field_50025_o", ";", "private", "int", "queuedLightChecks", ";", "boolean", "field_35638_u", ";", "public", "Chunk", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ")", "{", "storageArrays", "=", "new", "ExtendedBlockStorage", "[", "16", "]", ";", "blockBiomeArray", "=", "new", "byte", "[", "256", "]", ";", "precipitationHeightMap", "=", "new", "int", "[", "256", "]", ";", "updateSkylightColumns", "=", "new", "boolean", "[", "256", "]", ";", "isGapLightingUpdated", "=", "false", ";", "chunkTileEntityMap", "=", "new", "HashMap", "(", ")", ";", "isTerrainPopulated", "=", "false", ";", "isModified", "=", "false", ";", "hasEntities", "=", "false", ";", "lastSaveTime", "=", "0L", ";", "field_50025_o", "=", "false", ";", "queuedLightChecks", "=", "4096", ";", "field_35638_u", "=", "false", ";", "entityLists", "=", "new", "List", "[", "16", "]", ";", "worldObj", "=", "par1World", ";", "xPosition", "=", "par2", ";", "zPosition", "=", "par3", ";", "heightMap", "=", "new", "int", "[", "256", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "entityLists", ".", "length", ";", "i", "++", ")", "{", "entityLists", "[", "i", "]", "=", "new", "ArrayList", "(", ")", ";", "}", "Arrays", ".", "fill", "(", "precipitationHeightMap", ",", "-", "999", ")", ";", "Arrays", ".", "fill", "(", "blockBiomeArray", ",", "(", "byte", ")", "-", "1", ")", ";", "}", "public", "Chunk", "(", "World", "par1World", ",", "byte", "par2ArrayOfByte", "[", "]", ",", "int", "par3", ",", "int", "par4", ")", "{", "this", "(", "par1World", ",", "par3", ",", "par4", ")", ";", "int", "i", "=", "par2ArrayOfByte", ".", "length", "/", "256", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "16", ";", "j", "++", ")", "{", "for", "(", "int", "k", "=", "0", ";", "k", "<", "16", ";", "k", "++", ")", "{", "for", "(", "int", "l", "=", "0", ";", "l", "<", "i", ";", "l", "++", ")", "{", "byte", "byte0", "=", "par2ArrayOfByte", "[", "j", "<<", "11", "|", "k", "<<", "7", "|", "l", "]", ";", "if", "(", "byte0", "==", "0", ")", "{", "continue", ";", "}", "int", "i1", "=", "l", ">>", "4", ";", "if", "(", "storageArrays", "[", "i1", "]", "==", "null", ")", "{", "storageArrays", "[", "i1", "]", "=", "new", "ExtendedBlockStorage", "(", "i1", "<<", "4", ")", ";", "}", "storageArrays", "[", "i1", "]", ".", "setExtBlockID", "(", "j", ",", "l", "&", "0xf", ",", "k", ",", "byte0", ")", ";", "}", "}", "}", "}", "public", "boolean", "isAtLocation", "(", "int", "par1", ",", "int", "par2", ")", "{", "return", "par1", "==", "xPosition", "&&", "par2", "==", "zPosition", ";", "}", "public", "int", "getHeightValue", "(", "int", "par1", ",", "int", "par2", ")", "{", "return", "heightMap", "[", "par2", "<<", "4", "|", "par1", "]", ";", "}", "public", "int", "getTopFilledSegment", "(", ")", "{", "for", "(", "int", "i", "=", "storageArrays", ".", "length", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "if", "(", "storageArrays", "[", "i", "]", "!=", "null", ")", "{", "return", "storageArrays", "[", "i", "]", ".", "getYLocation", "(", ")", ";", "}", "}", "return", "0", ";", "}", "public", "ExtendedBlockStorage", "[", "]", "getBlockStorageArray", "(", ")", "{", "return", "storageArrays", ";", "}", "public", "void", "generateSkylightMap", "(", ")", "{", "int", "i", "=", "getTopFilledSegment", "(", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "16", ";", "j", "++", ")", "{", "for", "(", "int", "l", "=", "0", ";", "l", "<", "16", ";", "l", "++", ")", "{", "precipitationHeightMap", "[", "j", "+", "(", "l", "<<", "4", ")", "]", "=", "-", "999", ";", "int", "j1", "=", "(", "i", "+", "16", ")", "-", "1", ";", "do", "{", "if", "(", "j1", "<=", "0", ")", "{", "break", ";", "}", "if", "(", "getBlockLightOpacity", "(", "j", ",", "j1", "-", "1", ",", "l", ")", "!=", "0", ")", "{", "heightMap", "[", "l", "<<", "4", "|", "j", "]", "=", "j1", ";", "break", ";", "}", "j1", "--", ";", "}", "while", "(", "true", ")", ";", "if", "(", "worldObj", ".", "worldProvider", ".", "hasNoSky", ")", "{", "continue", ";", "}", "j1", "=", "15", ";", "int", "k1", "=", "(", "i", "+", "16", ")", "-", "1", ";", "do", "{", "j1", "-=", "getBlockLightOpacity", "(", "j", ",", "k1", ",", "l", ")", ";", "if", "(", "j1", ">", "0", ")", "{", "ExtendedBlockStorage", "extendedblockstorage", "=", "storageArrays", "[", "k1", ">>", "4", "]", ";", "if", "(", "extendedblockstorage", "!=", "null", ")", "{", "extendedblockstorage", ".", "setExtSkylightValue", "(", "j", ",", "k1", "&", "0xf", ",", "l", ",", "j1", ")", ";", "worldObj", ".", "func_48086_o", "(", "(", "xPosition", "<<", "4", ")", "+", "j", ",", "k1", ",", "(", "zPosition", "<<", "4", ")", "+", "l", ")", ";", "}", "}", "}", "while", "(", "--", "k1", ">", "0", "&&", "j1", ">", "0", ")", ";", "}", "}", "isModified", "=", "true", ";", "for", "(", "int", "k", "=", "0", ";", "k", "<", "16", ";", "k", "++", ")", "{", "for", "(", "int", "i1", "=", "0", ";", "i1", "<", "16", ";", "i1", "++", ")", "{", "propagateSkylightOcclusion", "(", "k", ",", "i1", ")", ";", "}", "}", "}", "public", "void", "func_4053_c", "(", ")", "{", "}", "private", "void", "propagateSkylightOcclusion", "(", "int", "par1", ",", "int", "par2", ")", "{", "updateSkylightColumns", "[", "par1", "+", "par2", "*", "16", "]", "=", "true", ";", "isGapLightingUpdated", "=", "true", ";", "}", "private", "void", "updateSkylight_do", "(", ")", "{", "Profiler", ".", "startSection", "(", "\"recheckGaps\"", ")", ";", "if", "(", "worldObj", ".", "doChunksNearChunkExist", "(", "xPosition", "*", "16", "+", "8", ",", "0", ",", "zPosition", "*", "16", "+", "8", ",", "16", ")", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "16", ";", "i", "++", ")", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<", "16", ";", "j", "++", ")", "{", "if", "(", "!", "updateSkylightColumns", "[", "i", "+", "j", "*", "16", "]", ")", "{", "continue", ";", "}", "updateSkylightColumns", "[", "i", "+", "j", "*", "16", "]", "=", "false", ";", "int", "k", "=", "getHeightValue", "(", "i", ",", "j", ")", ";", "int", "l", "=", "xPosition", "*", "16", "+", "i", ";", "int", "i1", "=", "zPosition", "*", "16", "+", "j", ";", "int", "j1", "=", "worldObj", ".", "getHeightValue", "(", "l", "-", "1", ",", "i1", ")", ";", "int", "k1", "=", "worldObj", ".", "getHeightValue", "(", "l", "+", "1", ",", "i1", ")", ";", "int", "l1", "=", "worldObj", ".", "getHeightValue", "(", "l", ",", "i1", "-", "1", ")", ";", "int", "i2", "=", "worldObj", ".", "getHeightValue", "(", "l", ",", "i1", "+", "1", ")", ";", "if", "(", "k1", "<", "j1", ")", "{", "j1", "=", "k1", ";", "}", "if", "(", "l1", "<", "j1", ")", "{", "j1", "=", "l1", ";", "}", "if", "(", "i2", "<", "j1", ")", "{", "j1", "=", "i2", ";", "}", "checkSkylightNeighborHeight", "(", "l", ",", "i1", ",", "j1", ")", ";", "checkSkylightNeighborHeight", "(", "l", "-", "1", ",", "i1", ",", "k", ")", ";", "checkSkylightNeighborHeight", "(", "l", "+", "1", ",", "i1", ",", "k", ")", ";", "checkSkylightNeighborHeight", "(", "l", ",", "i1", "-", "1", ",", "k", ")", ";", "checkSkylightNeighborHeight", "(", "l", ",", "i1", "+", "1", ",", "k", ")", ";", "}", "}", "isGapLightingUpdated", "=", "false", ";", "}", "Profiler", ".", "endSection", "(", ")", ";", "}", "private", "void", "checkSkylightNeighborHeight", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "int", "i", "=", "worldObj", ".", "getHeightValue", "(", "par1", ",", "par2", ")", ";", "if", "(", "i", ">", "par3", ")", "{", "updateSkylightNeighborHeight", "(", "par1", ",", "par2", ",", "par3", ",", "i", "+", "1", ")", ";", "}", "else", "if", "(", "i", "<", "par3", ")", "{", "updateSkylightNeighborHeight", "(", "par1", ",", "par2", ",", "i", ",", "par3", "+", "1", ")", ";", "}", "}", "private", "void", "updateSkylightNeighborHeight", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "if", "(", "par4", ">", "par3", "&&", "worldObj", ".", "doChunksNearChunkExist", "(", "par1", ",", "0", ",", "par2", ",", "16", ")", ")", "{", "for", "(", "int", "i", "=", "par3", ";", "i", "<", "par4", ";", "i", "++", ")", "{", "worldObj", ".", "updateLightByType", "(", "EnumSkyBlock", ".", "Sky", ",", "par1", ",", "i", ",", "par2", ")", ";", "}", "isModified", "=", "true", ";", "}", "}", "private", "void", "relightBlock", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "int", "i", "=", "heightMap", "[", "par3", "<<", "4", "|", "par1", "]", "&", "0xff", ";", "int", "j", "=", "i", ";", "if", "(", "par2", ">", "i", ")", "{", "j", "=", "par2", ";", "}", "for", "(", ";", "j", ">", "0", "&&", "getBlockLightOpacity", "(", "par1", ",", "j", "-", "1", ",", "par3", ")", "==", "0", ";", "j", "--", ")", "{", "}", "if", "(", "j", "==", "i", ")", "{", "return", ";", "}", "worldObj", ".", "markBlocksDirtyVertical", "(", "par1", ",", "par3", ",", "j", ",", "i", ")", ";", "heightMap", "[", "par3", "<<", "4", "|", "par1", "]", "=", "j", ";", "int", "k", "=", "xPosition", "*", "16", "+", "par1", ";", "int", "l", "=", "zPosition", "*", "16", "+", "par3", ";", "if", "(", "!", "worldObj", ".", "worldProvider", ".", "hasNoSky", ")", "{", "if", "(", "j", "<", "i", ")", "{", "for", "(", "int", "i1", "=", "j", ";", "i1", "<", "i", ";", "i1", "++", ")", "{", "ExtendedBlockStorage", "extendedblockstorage", "=", "storageArrays", "[", "i1", ">>", "4", "]", ";", "if", "(", "extendedblockstorage", "!=", "null", ")", "{", "extendedblockstorage", ".", "setExtSkylightValue", "(", "par1", ",", "i1", "&", "0xf", ",", "par3", ",", "15", ")", ";", "worldObj", ".", "func_48086_o", "(", "(", "xPosition", "<<", "4", ")", "+", "par1", ",", "i1", ",", "(", "zPosition", "<<", "4", ")", "+", "par3", ")", ";", "}", "}", "}", "else", "{", "for", "(", "int", "j1", "=", "i", ";", "j1", "<", "j", ";", "j1", "++", ")", "{", "ExtendedBlockStorage", "extendedblockstorage1", "=", "storageArrays", "[", "j1", ">>", "4", "]", ";", "if", "(", "extendedblockstorage1", "!=", "null", ")", "{", "extendedblockstorage1", ".", "setExtSkylightValue", "(", "par1", ",", "j1", "&", "0xf", ",", "par3", ",", "0", ")", ";", "worldObj", ".", "func_48086_o", "(", "(", "xPosition", "<<", "4", ")", "+", "par1", ",", "j1", ",", "(", "zPosition", "<<", "4", ")", "+", "par3", ")", ";", "}", "}", "}", "int", "k1", "=", "15", ";", "do", "{", "if", "(", "j", "<=", "0", "||", "k1", "<=", "0", ")", "{", "break", ";", "}", "j", "--", ";", "int", "i2", "=", "getBlockLightOpacity", "(", "par1", ",", "j", ",", "par3", ")", ";", "if", "(", "i2", "==", "0", ")", "{", "i2", "=", "1", ";", "}", "k1", "-=", "i2", ";", "if", "(", "k1", "<", "0", ")", "{", "k1", "=", "0", ";", "}", "ExtendedBlockStorage", "extendedblockstorage2", "=", "storageArrays", "[", "j", ">>", "4", "]", ";", "if", "(", "extendedblockstorage2", "!=", "null", ")", "{", "extendedblockstorage2", ".", "setExtSkylightValue", "(", "par1", ",", "j", "&", "0xf", ",", "par3", ",", "k1", ")", ";", "}", "}", "while", "(", "true", ")", ";", "}", "int", "l1", "=", "heightMap", "[", "par3", "<<", "4", "|", "par1", "]", ";", "int", "j2", "=", "i", ";", "int", "k2", "=", "l1", ";", "if", "(", "k2", "<", "j2", ")", "{", "int", "l2", "=", "j2", ";", "j2", "=", "k2", ";", "k2", "=", "l2", ";", "}", "if", "(", "!", "worldObj", ".", "worldProvider", ".", "hasNoSky", ")", "{", "updateSkylightNeighborHeight", "(", "k", "-", "1", ",", "l", ",", "j2", ",", "k2", ")", ";", "updateSkylightNeighborHeight", "(", "k", "+", "1", ",", "l", ",", "j2", ",", "k2", ")", ";", "updateSkylightNeighborHeight", "(", "k", ",", "l", "-", "1", ",", "j2", ",", "k2", ")", ";", "updateSkylightNeighborHeight", "(", "k", ",", "l", "+", "1", ",", "j2", ",", "k2", ")", ";", "updateSkylightNeighborHeight", "(", "k", ",", "l", ",", "j2", ",", "k2", ")", ";", "}", "isModified", "=", "true", ";", "}", "public", "int", "getBlockLightOpacity", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "return", "Block", ".", "lightOpacity", "[", "getBlockID", "(", "par1", ",", "par2", ",", "par3", ")", "]", ";", "}", "public", "int", "getBlockID", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "if", "(", "par2", ">>", "4", ">=", "storageArrays", ".", "length", ")", "{", "return", "0", ";", "}", "ExtendedBlockStorage", "extendedblockstorage", "=", "storageArrays", "[", "par2", ">>", "4", "]", ";", "if", "(", "extendedblockstorage", "!=", "null", ")", "{", "return", "extendedblockstorage", ".", "getExtBlockID", "(", "par1", ",", "par2", "&", "0xf", ",", "par3", ")", ";", "}", "else", "{", "return", "0", ";", "}", "}", "public", "int", "getBlockMetadata", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "if", "(", "par2", ">>", "4", ">=", "storageArrays", ".", "length", ")", "{", "return", "0", ";", "}", "ExtendedBlockStorage", "extendedblockstorage", "=", "storageArrays", "[", "par2", ">>", "4", "]", ";", "if", "(", "extendedblockstorage", "!=", "null", ")", "{", "return", "extendedblockstorage", ".", "getExtBlockMetadata", "(", "par1", ",", "par2", "&", "0xf", ",", "par3", ")", ";", "}", "else", "{", "return", "0", ";", "}", "}", "public", "boolean", "setBlockID", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "return", "setBlockIDWithMetadata", "(", "par1", ",", "par2", ",", "par3", ",", "par4", ",", "0", ")", ";", "}", "public", "boolean", "setBlockIDWithMetadata", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "int", "par5", ")", "{", "int", "i", "=", "par3", "<<", "4", "|", "par1", ";", "if", "(", "par2", ">=", "precipitationHeightMap", "[", "i", "]", "-", "1", ")", "{", "precipitationHeightMap", "[", "i", "]", "=", "-", "999", ";", "}", "int", "j", "=", "heightMap", "[", "i", "]", ";", "int", "k", "=", "getBlockID", "(", "par1", ",", "par2", ",", "par3", ")", ";", "if", "(", "k", "==", "par4", "&&", "getBlockMetadata", "(", "par1", ",", "par2", ",", "par3", ")", "==", "par5", ")", "{", "return", "false", ";", "}", "ExtendedBlockStorage", "extendedblockstorage", "=", "storageArrays", "[", "par2", ">>", "4", "]", ";", "boolean", "flag", "=", "false", ";", "if", "(", "extendedblockstorage", "==", "null", ")", "{", "if", "(", "par4", "==", "0", ")", "{", "return", "false", ";", "}", "extendedblockstorage", "=", "storageArrays", "[", "par2", ">>", "4", "]", "=", "new", "ExtendedBlockStorage", "(", "(", "par2", ">>", "4", ")", "<<", "4", ")", ";", "flag", "=", "par2", ">=", "j", ";", "}", "extendedblockstorage", ".", "setExtBlockID", "(", "par1", ",", "par2", "&", "0xf", ",", "par3", ",", "par4", ")", ";", "int", "l", "=", "xPosition", "*", "16", "+", "par1", ";", "int", "i1", "=", "zPosition", "*", "16", "+", "par3", ";", "if", "(", "k", "!=", "0", ")", "{", "if", "(", "!", "worldObj", ".", "isRemote", ")", "{", "Block", ".", "blocksList", "[", "k", "]", ".", "onBlockRemoval", "(", "worldObj", ",", "l", ",", "par2", ",", "i1", ")", ";", "}", "else", "if", "(", "(", "Block", ".", "blocksList", "[", "k", "]", "instanceof", "BlockContainer", ")", "&&", "k", "!=", "par4", ")", "{", "worldObj", ".", "removeBlockTileEntity", "(", "l", ",", "par2", ",", "i1", ")", ";", "}", "}", "if", "(", "extendedblockstorage", ".", "getExtBlockID", "(", "par1", ",", "par2", "&", "0xf", ",", "par3", ")", "!=", "par4", ")", "{", "return", "false", ";", "}", "extendedblockstorage", ".", "setExtBlockMetadata", "(", "par1", ",", "par2", "&", "0xf", ",", "par3", ",", "par5", ")", ";", "if", "(", "flag", ")", "{", "generateSkylightMap", "(", ")", ";", "}", "else", "{", "if", "(", "Block", ".", "lightOpacity", "[", "par4", "&", "0xfff", "]", ">", "0", ")", "{", "if", "(", "par2", ">=", "j", ")", "{", "relightBlock", "(", "par1", ",", "par2", "+", "1", ",", "par3", ")", ";", "}", "}", "else", "if", "(", "par2", "==", "j", "-", "1", ")", "{", "relightBlock", "(", "par1", ",", "par2", ",", "par3", ")", ";", "}", "propagateSkylightOcclusion", "(", "par1", ",", "par3", ")", ";", "}", "if", "(", "par4", "!=", "0", ")", "{", "if", "(", "!", "worldObj", ".", "isRemote", ")", "{", "Block", ".", "blocksList", "[", "par4", "]", ".", "onBlockAdded", "(", "worldObj", ",", "l", ",", "par2", ",", "i1", ")", ";", "}", "if", "(", "Block", ".", "blocksList", "[", "par4", "]", "instanceof", "BlockContainer", ")", "{", "TileEntity", "tileentity", "=", "getChunkBlockTileEntity", "(", "par1", ",", "par2", ",", "par3", ")", ";", "if", "(", "tileentity", "==", "null", ")", "{", "tileentity", "=", "(", "(", "BlockContainer", ")", "Block", ".", "blocksList", "[", "par4", "]", ")", ".", "getBlockEntity", "(", ")", ";", "worldObj", ".", "setBlockTileEntity", "(", "l", ",", "par2", ",", "i1", ",", "tileentity", ")", ";", "}", "if", "(", "tileentity", "!=", "null", ")", "{", "tileentity", ".", "updateContainingBlockInfo", "(", ")", ";", "}", "}", "}", "else", "if", "(", "k", ">", "0", "&&", "(", "Block", ".", "blocksList", "[", "k", "]", "instanceof", "BlockContainer", ")", ")", "{", "TileEntity", "tileentity1", "=", "getChunkBlockTileEntity", "(", "par1", ",", "par2", ",", "par3", ")", ";", "if", "(", "tileentity1", "!=", "null", ")", "{", "tileentity1", ".", "updateContainingBlockInfo", "(", ")", ";", "}", "}", "isModified", "=", "true", ";", "return", "true", ";", "}", "public", "boolean", "setBlockMetadata", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "ExtendedBlockStorage", "extendedblockstorage", "=", "storageArrays", "[", "par2", ">>", "4", "]", ";", "if", "(", "extendedblockstorage", "==", "null", ")", "{", "return", "false", ";", "}", "int", "i", "=", "extendedblockstorage", ".", "getExtBlockMetadata", "(", "par1", ",", "par2", "&", "0xf", ",", "par3", ")", ";", "if", "(", "i", "==", "par4", ")", "{", "return", "false", ";", "}", "isModified", "=", "true", ";", "extendedblockstorage", ".", "setExtBlockMetadata", "(", "par1", ",", "par2", "&", "0xf", ",", "par3", ",", "par4", ")", ";", "int", "j", "=", "extendedblockstorage", ".", "getExtBlockID", "(", "par1", ",", "par2", "&", "0xf", ",", "par3", ")", ";", "if", "(", "j", ">", "0", "&&", "(", "Block", ".", "blocksList", "[", "j", "]", "instanceof", "BlockContainer", ")", ")", "{", "TileEntity", "tileentity", "=", "getChunkBlockTileEntity", "(", "par1", ",", "par2", ",", "par3", ")", ";", "if", "(", "tileentity", "!=", "null", ")", "{", "tileentity", ".", "updateContainingBlockInfo", "(", ")", ";", "tileentity", ".", "blockMetadata", "=", "par4", ";", "}", "}", "return", "true", ";", "}", "public", "int", "getSavedLightValue", "(", "EnumSkyBlock", "par1EnumSkyBlock", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "ExtendedBlockStorage", "extendedblockstorage", "=", "storageArrays", "[", "par3", ">>", "4", "]", ";", "if", "(", "extendedblockstorage", "==", "null", ")", "{", "return", "par1EnumSkyBlock", ".", "defaultLightValue", ";", "}", "if", "(", "par1EnumSkyBlock", "==", "EnumSkyBlock", ".", "Sky", ")", "{", "return", "extendedblockstorage", ".", "getExtSkylightValue", "(", "par2", ",", "par3", "&", "0xf", ",", "par4", ")", ";", "}", "if", "(", "par1EnumSkyBlock", "==", "EnumSkyBlock", ".", "Block", ")", "{", "return", "extendedblockstorage", ".", "getExtBlocklightValue", "(", "par2", ",", "par3", "&", "0xf", ",", "par4", ")", ";", "}", "else", "{", "return", "par1EnumSkyBlock", ".", "defaultLightValue", ";", "}", "}", "public", "void", "setLightValue", "(", "EnumSkyBlock", "par1EnumSkyBlock", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "int", "par5", ")", "{", "ExtendedBlockStorage", "extendedblockstorage", "=", "storageArrays", "[", "par3", ">>", "4", "]", ";", "if", "(", "extendedblockstorage", "==", "null", ")", "{", "extendedblockstorage", "=", "storageArrays", "[", "par3", ">>", "4", "]", "=", "new", "ExtendedBlockStorage", "(", "(", "par3", ">>", "4", ")", "<<", "4", ")", ";", "generateSkylightMap", "(", ")", ";", "}", "isModified", "=", "true", ";", "if", "(", "par1EnumSkyBlock", "==", "EnumSkyBlock", ".", "Sky", ")", "{", "if", "(", "!", "worldObj", ".", "worldProvider", ".", "hasNoSky", ")", "{", "extendedblockstorage", ".", "setExtSkylightValue", "(", "par2", ",", "par3", "&", "0xf", ",", "par4", ",", "par5", ")", ";", "}", "}", "else", "if", "(", "par1EnumSkyBlock", "==", "EnumSkyBlock", ".", "Block", ")", "{", "extendedblockstorage", ".", "setExtBlocklightValue", "(", "par2", ",", "par3", "&", "0xf", ",", "par4", ",", "par5", ")", ";", "}", "else", "{", "return", ";", "}", "}", "public", "int", "getBlockLightValue", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "ExtendedBlockStorage", "extendedblockstorage", "=", "storageArrays", "[", "par2", ">>", "4", "]", ";", "if", "(", "extendedblockstorage", "==", "null", ")", "{", "if", "(", "!", "worldObj", ".", "worldProvider", ".", "hasNoSky", "&&", "par4", "<", "EnumSkyBlock", ".", "Sky", ".", "defaultLightValue", ")", "{", "return", "EnumSkyBlock", ".", "Sky", ".", "defaultLightValue", "-", "par4", ";", "}", "else", "{", "return", "0", ";", "}", "}", "int", "i", "=", "worldObj", ".", "worldProvider", ".", "hasNoSky", "?", "0", ":", "extendedblockstorage", ".", "getExtSkylightValue", "(", "par1", ",", "par2", "&", "0xf", ",", "par3", ")", ";", "if", "(", "i", ">", "0", ")", "{", "isLit", "=", "true", ";", "}", "i", "-=", "par4", ";", "int", "j", "=", "extendedblockstorage", ".", "getExtBlocklightValue", "(", "par1", ",", "par2", "&", "0xf", ",", "par3", ")", ";", "if", "(", "j", ">", "i", ")", "{", "i", "=", "j", ";", "}", "return", "i", ";", "}", "public", "void", "addEntity", "(", "Entity", "par1Entity", ")", "{", "hasEntities", "=", "true", ";", "int", "i", "=", "MathHelper", ".", "floor_double", "(", "par1Entity", ".", "posX", "/", "16D", ")", ";", "int", "j", "=", "MathHelper", ".", "floor_double", "(", "par1Entity", ".", "posZ", "/", "16D", ")", ";", "if", "(", "i", "!=", "xPosition", "||", "j", "!=", "zPosition", ")", "{", "System", ".", "out", ".", "println", "(", "(", "new", "StringBuilder", "(", ")", ")", ".", "append", "(", "\"\"", ")", ".", "append", "(", "par1Entity", ")", ".", "toString", "(", ")", ")", ";", "Thread", ".", "dumpStack", "(", ")", ";", "}", "int", "k", "=", "MathHelper", ".", "floor_double", "(", "par1Entity", ".", "posY", "/", "16D", ")", ";", "if", "(", "k", "<", "0", ")", "{", "k", "=", "0", ";", "}", "if", "(", "k", ">=", "entityLists", ".", "length", ")", "{", "k", "=", "entityLists", ".", "length", "-", "1", ";", "}", "par1Entity", ".", "addedToChunk", "=", "true", ";", "par1Entity", ".", "chunkCoordX", "=", "xPosition", ";", "par1Entity", ".", "chunkCoordY", "=", "k", ";", "par1Entity", ".", "chunkCoordZ", "=", "zPosition", ";", "entityLists", "[", "k", "]", ".", "add", "(", "par1Entity", ")", ";", "}", "public", "void", "removeEntity", "(", "Entity", "par1Entity", ")", "{", "removeEntityAtIndex", "(", "par1Entity", ",", "par1Entity", ".", "chunkCoordY", ")", ";", "}", "public", "void", "removeEntityAtIndex", "(", "Entity", "par1Entity", ",", "int", "par2", ")", "{", "if", "(", "par2", "<", "0", ")", "{", "par2", "=", "0", ";", "}", "if", "(", "par2", ">=", "entityLists", ".", "length", ")", "{", "par2", "=", "entityLists", ".", "length", "-", "1", ";", "}", "entityLists", "[", "par2", "]", ".", "remove", "(", "par1Entity", ")", ";", "}", "public", "boolean", "canBlockSeeTheSky", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "return", "par2", ">=", "heightMap", "[", "par3", "<<", "4", "|", "par1", "]", ";", "}", "public", "TileEntity", "getChunkBlockTileEntity", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "ChunkPosition", "chunkposition", "=", "new", "ChunkPosition", "(", "par1", ",", "par2", ",", "par3", ")", ";", "TileEntity", "tileentity", "=", "(", "TileEntity", ")", "chunkTileEntityMap", ".", "get", "(", "chunkposition", ")", ";", "if", "(", "tileentity", "==", "null", ")", "{", "int", "i", "=", "getBlockID", "(", "par1", ",", "par2", ",", "par3", ")", ";", "if", "(", "i", "<=", "0", "||", "!", "Block", ".", "blocksList", "[", "i", "]", ".", "hasTileEntity", "(", ")", ")", "{", "return", "null", ";", "}", "if", "(", "tileentity", "==", "null", ")", "{", "tileentity", "=", "(", "(", "BlockContainer", ")", "Block", ".", "blocksList", "[", "i", "]", ")", ".", "getBlockEntity", "(", ")", ";", "worldObj", ".", "setBlockTileEntity", "(", "xPosition", "*", "16", "+", "par1", ",", "par2", ",", "zPosition", "*", "16", "+", "par3", ",", "tileentity", ")", ";", "}", "tileentity", "=", "(", "TileEntity", ")", "chunkTileEntityMap", ".", "get", "(", "chunkposition", ")", ";", "}", "if", "(", "tileentity", "!=", "null", "&&", "tileentity", ".", "isInvalid", "(", ")", ")", "{", "chunkTileEntityMap", ".", "remove", "(", "chunkposition", ")", ";", "return", "null", ";", "}", "else", "{", "return", "tileentity", ";", "}", "}", "public", "void", "addTileEntity", "(", "TileEntity", "par1TileEntity", ")", "{", "int", "i", "=", "par1TileEntity", ".", "xCoord", "-", "xPosition", "*", "16", ";", "int", "j", "=", "par1TileEntity", ".", "yCoord", ";", "int", "k", "=", "par1TileEntity", ".", "zCoord", "-", "zPosition", "*", "16", ";", "setChunkBlockTileEntity", "(", "i", ",", "j", ",", "k", ",", "par1TileEntity", ")", ";", "if", "(", "isChunkLoaded", ")", "{", "worldObj", ".", "loadedTileEntityList", ".", "add", "(", "par1TileEntity", ")", ";", "}", "}", "public", "void", "setChunkBlockTileEntity", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "TileEntity", "par4TileEntity", ")", "{", "ChunkPosition", "chunkposition", "=", "new", "ChunkPosition", "(", "par1", ",", "par2", ",", "par3", ")", ";", "par4TileEntity", ".", "worldObj", "=", "worldObj", ";", "par4TileEntity", ".", "xCoord", "=", "xPosition", "*", "16", "+", "par1", ";", "par4TileEntity", ".", "yCoord", "=", "par2", ";", "par4TileEntity", ".", "zCoord", "=", "zPosition", "*", "16", "+", "par3", ";", "if", "(", "getBlockID", "(", "par1", ",", "par2", ",", "par3", ")", "==", "0", "||", "!", "(", "Block", ".", "blocksList", "[", "getBlockID", "(", "par1", ",", "par2", ",", "par3", ")", "]", "instanceof", "BlockContainer", ")", ")", "{", "return", ";", "}", "else", "{", "par4TileEntity", ".", "validate", "(", ")", ";", "chunkTileEntityMap", ".", "put", "(", "chunkposition", ",", "par4TileEntity", ")", ";", "return", ";", "}", "}", "public", "void", "removeChunkBlockTileEntity", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "ChunkPosition", "chunkposition", "=", "new", "ChunkPosition", "(", "par1", ",", "par2", ",", "par3", ")", ";", "if", "(", "isChunkLoaded", ")", "{", "TileEntity", "tileentity", "=", "(", "TileEntity", ")", "chunkTileEntityMap", ".", "remove", "(", "chunkposition", ")", ";", "if", "(", "tileentity", "!=", "null", ")", "{", "tileentity", ".", "invalidate", "(", ")", ";", "}", "}", "}", "public", "void", "onChunkLoad", "(", ")", "{", "isChunkLoaded", "=", "true", ";", "worldObj", ".", "addTileEntity", "(", "chunkTileEntityMap", ".", "values", "(", ")", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "entityLists", ".", "length", ";", "i", "++", ")", "{", "worldObj", ".", "addLoadedEntities", "(", "entityLists", "[", "i", "]", ")", ";", "}", "}", "public", "void", "onChunkUnload", "(", ")", "{", "isChunkLoaded", "=", "false", ";", "TileEntity", "tileentity", ";", "for", "(", "Iterator", "iterator", "=", "chunkTileEntityMap", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", "worldObj", ".", "markTileEntityForDespawn", "(", "tileentity", ")", ")", "{", "tileentity", "=", "(", "TileEntity", ")", "iterator", ".", "next", "(", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "entityLists", ".", "length", ";", "i", "++", ")", "{", "worldObj", ".", "unloadEntities", "(", "entityLists", "[", "i", "]", ")", ";", "}", "}", "public", "void", "setChunkModified", "(", ")", "{", "isModified", "=", "true", ";", "}", "public", "void", "getEntitiesWithinAABBForEntity", "(", "Entity", "par1Entity", ",", "AxisAlignedBB", "par2AxisAlignedBB", ",", "List", "par3List", ")", "{", "int", "i", "=", "MathHelper", ".", "floor_double", "(", "(", "par2AxisAlignedBB", ".", "minY", "-", "2D", ")", "/", "16D", ")", ";", "int", "j", "=", "MathHelper", ".", "floor_double", "(", "(", "par2AxisAlignedBB", ".", "maxY", "+", "2D", ")", "/", "16D", ")", ";", "if", "(", "i", "<", "0", ")", "{", "i", "=", "0", ";", "}", "if", "(", "j", ">=", "entityLists", ".", "length", ")", "{", "j", "=", "entityLists", ".", "length", "-", "1", ";", "}", "for", "(", "int", "k", "=", "i", ";", "k", "<=", "j", ";", "k", "++", ")", "{", "List", "list", "=", "entityLists", "[", "k", "]", ";", "for", "(", "int", "l", "=", "0", ";", "l", "<", "list", ".", "size", "(", ")", ";", "l", "++", ")", "{", "Entity", "entity", "=", "(", "Entity", ")", "list", ".", "get", "(", "l", ")", ";", "if", "(", "entity", "==", "par1Entity", "||", "!", "entity", ".", "boundingBox", ".", "intersectsWith", "(", "par2AxisAlignedBB", ")", ")", "{", "continue", ";", "}", "par3List", ".", "add", "(", "entity", ")", ";", "Entity", "aentity", "[", "]", "=", "entity", ".", "getParts", "(", ")", ";", "if", "(", "aentity", "==", "null", ")", "{", "continue", ";", "}", "for", "(", "int", "i1", "=", "0", ";", "i1", "<", "aentity", ".", "length", ";", "i1", "++", ")", "{", "Entity", "entity1", "=", "aentity", "[", "i1", "]", ";", "if", "(", "entity1", "!=", "par1Entity", "&&", "entity1", ".", "boundingBox", ".", "intersectsWith", "(", "par2AxisAlignedBB", ")", ")", "{", "par3List", ".", "add", "(", "entity1", ")", ";", "}", "}", "}", "}", "}", "public", "void", "getEntitiesOfTypeWithinAAAB", "(", "Class", "par1Class", ",", "AxisAlignedBB", "par2AxisAlignedBB", ",", "List", "par3List", ")", "{", "int", "i", "=", "MathHelper", ".", "floor_double", "(", "(", "par2AxisAlignedBB", ".", "minY", "-", "2D", ")", "/", "16D", ")", ";", "int", "j", "=", "MathHelper", ".", "floor_double", "(", "(", "par2AxisAlignedBB", ".", "maxY", "+", "2D", ")", "/", "16D", ")", ";", "if", "(", "i", "<", "0", ")", "{", "i", "=", "0", ";", "}", "else", "if", "(", "i", ">=", "entityLists", ".", "length", ")", "{", "i", "=", "entityLists", ".", "length", "-", "1", ";", "}", "if", "(", "j", ">=", "entityLists", ".", "length", ")", "{", "j", "=", "entityLists", ".", "length", "-", "1", ";", "}", "else", "if", "(", "j", "<", "0", ")", "{", "j", "=", "0", ";", "}", "for", "(", "int", "k", "=", "i", ";", "k", "<=", "j", ";", "k", "++", ")", "{", "List", "list", "=", "entityLists", "[", "k", "]", ";", "for", "(", "int", "l", "=", "0", ";", "l", "<", "list", ".", "size", "(", ")", ";", "l", "++", ")", "{", "Entity", "entity", "=", "(", "Entity", ")", "list", ".", "get", "(", "l", ")", ";", "if", "(", "par1Class", ".", "isAssignableFrom", "(", "entity", ".", "getClass", "(", ")", ")", "&&", "entity", ".", "boundingBox", ".", "intersectsWith", "(", "par2AxisAlignedBB", ")", ")", "{", "par3List", ".", "add", "(", "entity", ")", ";", "}", "}", "}", "}", "public", "boolean", "needsSaving", "(", "boolean", "par1", ")", "{", "if", "(", "par1", ")", "{", "if", "(", "hasEntities", "&&", "worldObj", ".", "getWorldTime", "(", ")", "!=", "lastSaveTime", ")", "{", "return", "true", ";", "}", "}", "else", "if", "(", "hasEntities", "&&", "worldObj", ".", "getWorldTime", "(", ")", ">=", "lastSaveTime", "+", "600L", ")", "{", "return", "true", ";", "}", "return", "isModified", ";", "}", "public", "Random", "getRandomWithSeed", "(", "long", "par1", ")", "{", "return", "new", "Random", "(", "worldObj", ".", "getSeed", "(", ")", "+", "(", "long", ")", "(", "xPosition", "*", "xPosition", "*", "0x4c1906", ")", "+", "(", "long", ")", "(", "xPosition", "*", "0x5ac0db", ")", "+", "(", "long", ")", "(", "zPosition", "*", "zPosition", ")", "*", "0x4307a7L", "+", "(", "long", ")", "(", "zPosition", "*", "0x5f24f", ")", "^", "par1", ")", ";", "}", "public", "boolean", "isEmpty", "(", ")", "{", "return", "false", ";", "}", "public", "void", "removeUnknownBlocks", "(", ")", "{", "ExtendedBlockStorage", "aextendedblockstorage", "[", "]", "=", "storageArrays", ";", "int", "i", "=", "aextendedblockstorage", ".", "length", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "i", ";", "j", "++", ")", "{", "ExtendedBlockStorage", "extendedblockstorage", "=", "aextendedblockstorage", "[", "j", "]", ";", "if", "(", "extendedblockstorage", "!=", "null", ")", "{", "extendedblockstorage", ".", "func_48603_e", "(", ")", ";", "}", "}", "}", "public", "void", "populateChunk", "(", "IChunkProvider", "par1IChunkProvider", ",", "IChunkProvider", "par2IChunkProvider", ",", "int", "par3", ",", "int", "par4", ")", "{", "if", "(", "!", "isTerrainPopulated", "&&", "par1IChunkProvider", ".", "chunkExists", "(", "par3", "+", "1", ",", "par4", "+", "1", ")", "&&", "par1IChunkProvider", ".", "chunkExists", "(", "par3", ",", "par4", "+", "1", ")", "&&", "par1IChunkProvider", ".", "chunkExists", "(", "par3", "+", "1", ",", "par4", ")", ")", "{", "par1IChunkProvider", ".", "populate", "(", "par2IChunkProvider", ",", "par3", ",", "par4", ")", ";", "}", "if", "(", "par1IChunkProvider", ".", "chunkExists", "(", "par3", "-", "1", ",", "par4", ")", "&&", "!", "par1IChunkProvider", ".", "provideChunk", "(", "par3", "-", "1", ",", "par4", ")", ".", "isTerrainPopulated", "&&", "par1IChunkProvider", ".", "chunkExists", "(", "par3", "-", "1", ",", "par4", "+", "1", ")", "&&", "par1IChunkProvider", ".", "chunkExists", "(", "par3", ",", "par4", "+", "1", ")", "&&", "par1IChunkProvider", ".", "chunkExists", "(", "par3", "-", "1", ",", "par4", "+", "1", ")", ")", "{", "par1IChunkProvider", ".", "populate", "(", "par2IChunkProvider", ",", "par3", "-", "1", ",", "par4", ")", ";", "}", "if", "(", "par1IChunkProvider", ".", "chunkExists", "(", "par3", ",", "par4", "-", "1", ")", "&&", "!", "par1IChunkProvider", ".", "provideChunk", "(", "par3", ",", "par4", "-", "1", ")", ".", "isTerrainPopulated", "&&", "par1IChunkProvider", ".", "chunkExists", "(", "par3", "+", "1", ",", "par4", "-", "1", ")", "&&", "par1IChunkProvider", ".", "chunkExists", "(", "par3", "+", "1", ",", "par4", "-", "1", ")", "&&", "par1IChunkProvider", ".", "chunkExists", "(", "par3", "+", "1", ",", "par4", ")", ")", "{", "par1IChunkProvider", ".", "populate", "(", "par2IChunkProvider", ",", "par3", ",", "par4", "-", "1", ")", ";", "}", "if", "(", "par1IChunkProvider", ".", "chunkExists", "(", "par3", "-", "1", ",", "par4", "-", "1", ")", "&&", "!", "par1IChunkProvider", ".", "provideChunk", "(", "par3", "-", "1", ",", "par4", "-", "1", ")", ".", "isTerrainPopulated", "&&", "par1IChunkProvider", ".", "chunkExists", "(", "par3", ",", "par4", "-", "1", ")", "&&", "par1IChunkProvider", ".", "chunkExists", "(", "par3", "-", "1", ",", "par4", ")", ")", "{", "par1IChunkProvider", ".", "populate", "(", "par2IChunkProvider", ",", "par3", "-", "1", ",", "par4", "-", "1", ")", ";", "}", "}", "public", "int", "getPrecipitationHeight", "(", "int", "par1", ",", "int", "par2", ")", "{", "int", "i", "=", "par1", "|", "par2", "<<", "4", ";", "int", "j", "=", "precipitationHeightMap", "[", "i", "]", ";", "if", "(", "j", "==", "-", "999", ")", "{", "int", "k", "=", "getTopFilledSegment", "(", ")", "+", "15", ";", "for", "(", "j", "=", "-", "1", ";", "k", ">", "0", "&&", "j", "==", "-", "1", ";", ")", "{", "int", "l", "=", "getBlockID", "(", "par1", ",", "k", ",", "par2", ")", ";", "Material", "material", "=", "l", "!=", "0", "?", "Block", ".", "blocksList", "[", "l", "]", ".", "blockMaterial", ":", "Material", ".", "air", ";", "if", "(", "!", "material", ".", "blocksMovement", "(", ")", "&&", "!", "material", ".", "isLiquid", "(", ")", ")", "{", "k", "--", ";", "}", "else", "{", "j", "=", "k", "+", "1", ";", "}", "}", "precipitationHeightMap", "[", "i", "]", "=", "j", ";", "}", "return", "j", ";", "}", "public", "void", "updateSkylight", "(", ")", "{", "if", "(", "isGapLightingUpdated", "&&", "!", "worldObj", ".", "worldProvider", ".", "hasNoSky", ")", "{", "updateSkylight_do", "(", ")", ";", "}", "}", "public", "ChunkCoordIntPair", "getChunkCoordIntPair", "(", ")", "{", "return", "new", "ChunkCoordIntPair", "(", "xPosition", ",", "zPosition", ")", ";", "}", "public", "boolean", "getAreLevelsEmpty", "(", "int", "par1", ",", "int", "par2", ")", "{", "if", "(", "par1", "<", "0", ")", "{", "par1", "=", "0", ";", "}", "if", "(", "par2", ">=", "256", ")", "{", "par2", "=", "255", ";", "}", "for", "(", "int", "i", "=", "par1", ";", "i", "<=", "par2", ";", "i", "+=", "16", ")", "{", "ExtendedBlockStorage", "extendedblockstorage", "=", "storageArrays", "[", "i", ">>", "4", "]", ";", "if", "(", "extendedblockstorage", "!=", "null", "&&", "!", "extendedblockstorage", ".", "getIsEmpty", "(", ")", ")", "{", "return", "false", ";", "}", "}", "return", "true", ";", "}", "public", "void", "setStorageArrays", "(", "ExtendedBlockStorage", "par1ArrayOfExtendedBlockStorage", "[", "]", ")", "{", "storageArrays", "=", "par1ArrayOfExtendedBlockStorage", ";", "}", "public", "BiomeGenBase", "func_48560_a", "(", "int", "par1", ",", "int", "par2", ",", "WorldChunkManager", "par3WorldChunkManager", ")", "{", "int", "i", "=", "blockBiomeArray", "[", "par2", "<<", "4", "|", "par1", "]", "&", "0xff", ";", "if", "(", "i", "==", "255", ")", "{", "BiomeGenBase", "biomegenbase", "=", "par3WorldChunkManager", ".", "getBiomeGenAt", "(", "(", "xPosition", "<<", "4", ")", "+", "par1", ",", "(", "zPosition", "<<", "4", ")", "+", "par2", ")", ";", "i", "=", "biomegenbase", ".", "biomeID", ";", "blockBiomeArray", "[", "par2", "<<", "4", "|", "par1", "]", "=", "(", "byte", ")", "(", "i", "&", "0xff", ")", ";", "}", "if", "(", "BiomeGenBase", ".", "biomeList", "[", "i", "]", "==", "null", ")", "{", "return", "BiomeGenBase", ".", "plains", ";", "}", "else", "{", "return", "BiomeGenBase", ".", "biomeList", "[", "i", "]", ";", "}", "}", "public", "byte", "[", "]", "getBiomeArray", "(", ")", "{", "return", "blockBiomeArray", ";", "}", "public", "void", "setBiomeArray", "(", "byte", "par1ArrayOfByte", "[", "]", ")", "{", "blockBiomeArray", "=", "par1ArrayOfByte", ";", "}", "public", "void", "resetRelightChecks", "(", ")", "{", "queuedLightChecks", "=", "0", ";", "}", "public", "void", "enqueueRelightChecks", "(", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "8", ";", "i", "++", ")", "{", "if", "(", "queuedLightChecks", ">=", "4096", ")", "{", "return", ";", "}", "int", "j", "=", "queuedLightChecks", "%", "16", ";", "int", "k", "=", "(", "queuedLightChecks", "/", "16", ")", "%", "16", ";", "int", "l", "=", "queuedLightChecks", "/", "256", ";", "queuedLightChecks", "++", ";", "int", "i1", "=", "(", "xPosition", "<<", "4", ")", "+", "k", ";", "int", "j1", "=", "(", "zPosition", "<<", "4", ")", "+", "l", ";", "for", "(", "int", "k1", "=", "0", ";", "k1", "<", "16", ";", "k1", "++", ")", "{", "int", "l1", "=", "(", "j", "<<", "4", ")", "+", "k1", ";", "if", "(", "(", "storageArrays", "[", "j", "]", "!=", "null", "||", "k1", "!=", "0", "&&", "k1", "!=", "15", "&&", "k", "!=", "0", "&&", "k", "!=", "15", "&&", "l", "!=", "0", "&&", "l", "!=", "15", ")", "&&", "(", "storageArrays", "[", "j", "]", "==", "null", "||", "storageArrays", "[", "j", "]", ".", "getExtBlockID", "(", "k", ",", "k1", ",", "l", ")", "!=", "0", ")", ")", "{", "continue", ";", "}", "if", "(", "Block", ".", "lightValue", "[", "worldObj", ".", "getBlockId", "(", "i1", ",", "l1", "-", "1", ",", "j1", ")", "]", ">", "0", ")", "{", "worldObj", ".", "updateAllLightTypes", "(", "i1", ",", "l1", "-", "1", ",", "j1", ")", ";", "}", "if", "(", "Block", ".", "lightValue", "[", "worldObj", ".", "getBlockId", "(", "i1", ",", "l1", "+", "1", ",", "j1", ")", "]", ">", "0", ")", "{", "worldObj", ".", "updateAllLightTypes", "(", "i1", ",", "l1", "+", "1", ",", "j1", ")", ";", "}", "if", "(", "Block", ".", "lightValue", "[", "worldObj", ".", "getBlockId", "(", "i1", "-", "1", ",", "l1", ",", "j1", ")", "]", ">", "0", ")", "{", "worldObj", ".", "updateAllLightTypes", "(", "i1", "-", "1", ",", "l1", ",", "j1", ")", ";", "}", "if", "(", "Block", ".", "lightValue", "[", "worldObj", ".", "getBlockId", "(", "i1", "+", "1", ",", "l1", ",", "j1", ")", "]", ">", "0", ")", "{", "worldObj", ".", "updateAllLightTypes", "(", "i1", "+", "1", ",", "l1", ",", "j1", ")", ";", "}", "if", "(", "Block", ".", "lightValue", "[", "worldObj", ".", "getBlockId", "(", "i1", ",", "l1", ",", "j1", "-", "1", ")", "]", ">", "0", ")", "{", "worldObj", ".", "updateAllLightTypes", "(", "i1", ",", "l1", ",", "j1", "-", "1", ")", ";", "}", "if", "(", "Block", ".", "lightValue", "[", "worldObj", ".", "getBlockId", "(", "i1", ",", "l1", ",", "j1", "+", "1", ")", "]", ">", "0", ")", "{", "worldObj", ".", "updateAllLightTypes", "(", "i1", ",", "l1", ",", "j1", "+", "1", ")", ";", "}", "worldObj", ".", "updateAllLightTypes", "(", "i1", ",", "l1", ",", "j1", ")", ";", "}", "}", "}", "}", "</s>" ]
9,923
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "class", "EntityAITaskEntry", "{", "public", "EntityAIBase", "action", ";", "public", "int", "priority", ";", "final", "EntityAITasks", "tasks", ";", "public", "EntityAITaskEntry", "(", "EntityAITasks", "par1EntityAITasks", ",", "int", "par2", ",", "EntityAIBase", "par3EntityAIBase", ")", "{", "tasks", "=", "par1EntityAITasks", ";", "priority", "=", "par2", ";", "action", "=", "par3EntityAIBase", ";", "}", "}", "</s>" ]
9,924
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "List", ";", "public", "class", "EntityAIHurtByTarget", "extends", "EntityAITarget", "{", "boolean", "field_48300_a", ";", "public", "EntityAIHurtByTarget", "(", "EntityLiving", "par1EntityLiving", ",", "boolean", "par2", ")", "{", "super", "(", "par1EntityLiving", ",", "16F", ",", "false", ")", ";", "field_48300_a", "=", "par2", ";", "setMutexBits", "(", "1", ")", ";", "}", "public", "boolean", "shouldExecute", "(", ")", "{", "return", "func_48284_a", "(", "taskOwner", ".", "getAITarget", "(", ")", ",", "true", ")", ";", "}", "public", "void", "startExecuting", "(", ")", "{", "taskOwner", ".", "setAttackTarget", "(", "taskOwner", ".", "getAITarget", "(", ")", ")", ";", "if", "(", "field_48300_a", ")", "{", "List", "list", "=", "taskOwner", ".", "worldObj", ".", "getEntitiesWithinAABB", "(", "taskOwner", ".", "getClass", "(", ")", ",", "AxisAlignedBB", ".", "getBoundingBoxFromPool", "(", "taskOwner", ".", "posX", ",", "taskOwner", ".", "posY", ",", "taskOwner", ".", "posZ", ",", "taskOwner", ".", "posX", "+", "1.0D", ",", "taskOwner", ".", "posY", "+", "1.0D", ",", "taskOwner", ".", "posZ", "+", "1.0D", ")", ".", "expand", "(", "field_48288_d", ",", "4D", ",", "field_48288_d", ")", ")", ";", "Iterator", "iterator", "=", "list", ".", "iterator", "(", ")", ";", "do", "{", "if", "(", "!", "iterator", ".", "hasNext", "(", ")", ")", "{", "break", ";", "}", "Entity", "entity", "=", "(", "Entity", ")", "iterator", ".", "next", "(", ")", ";", "EntityLiving", "entityliving", "=", "(", "EntityLiving", ")", "entity", ";", "if", "(", "taskOwner", "!=", "entityliving", "&&", "entityliving", ".", "getAttackTarget", "(", ")", "==", "null", ")", "{", "entityliving", ".", "setAttackTarget", "(", "taskOwner", ".", "getAITarget", "(", ")", ")", ";", "}", "}", "while", "(", "true", ")", ";", "}", "super", ".", "startExecuting", "(", ")", ";", "}", "}", "</s>" ]
9,925
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "ContainerEnchantment", "extends", "Container", "{", "public", "IInventory", "tableInventory", ";", "private", "World", "worldPointer", ";", "private", "int", "posX", ";", "private", "int", "posY", ";", "private", "int", "posZ", ";", "private", "Random", "rand", ";", "public", "long", "nameSeed", ";", "public", "int", "enchantLevels", "[", "]", ";", "public", "ContainerEnchantment", "(", "InventoryPlayer", "par1InventoryPlayer", ",", "World", "par2World", ",", "int", "par3", ",", "int", "par4", ",", "int", "par5", ")", "{", "tableInventory", "=", "new", "SlotEnchantmentTable", "(", "this", ",", "\"Enchant\"", ",", "1", ")", ";", "rand", "=", "new", "Random", "(", ")", ";", "enchantLevels", "=", "new", "int", "[", "3", "]", ";", "worldPointer", "=", "par2World", ";", "posX", "=", "par3", ";", "posY", "=", "par4", ";", "posZ", "=", "par5", ";", "addSlot", "(", "new", "SlotEnchantment", "(", "this", ",", "tableInventory", ",", "0", ",", "25", ",", "47", ")", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "3", ";", "i", "++", ")", "{", "for", "(", "int", "k", "=", "0", ";", "k", "<", "9", ";", "k", "++", ")", "{", "addSlot", "(", "new", "Slot", "(", "par1InventoryPlayer", ",", "k", "+", "i", "*", "9", "+", "9", ",", "8", "+", "k", "*", "18", ",", "84", "+", "i", "*", "18", ")", ")", ";", "}", "}", "for", "(", "int", "j", "=", "0", ";", "j", "<", "9", ";", "j", "++", ")", "{", "addSlot", "(", "new", "Slot", "(", "par1InventoryPlayer", ",", "j", ",", "8", "+", "j", "*", "18", ",", "142", ")", ")", ";", "}", "}", "public", "void", "onCraftGuiOpened", "(", "ICrafting", "par1ICrafting", ")", "{", "super", ".", "onCraftGuiOpened", "(", "par1ICrafting", ")", ";", "par1ICrafting", ".", "updateCraftingInventoryInfo", "(", "this", ",", "0", ",", "enchantLevels", "[", "0", "]", ")", ";", "par1ICrafting", ".", "updateCraftingInventoryInfo", "(", "this", ",", "1", ",", "enchantLevels", "[", "1", "]", ")", ";", "par1ICrafting", ".", "updateCraftingInventoryInfo", "(", "this", ",", "2", ",", "enchantLevels", "[", "2", "]", ")", ";", "}", "public", "void", "updateCraftingResults", "(", ")", "{", "super", ".", "updateCraftingResults", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "crafters", ".", "size", "(", ")", ";", "i", "++", ")", "{", "ICrafting", "icrafting", "=", "(", "ICrafting", ")", "crafters", ".", "get", "(", "i", ")", ";", "icrafting", ".", "updateCraftingInventoryInfo", "(", "this", ",", "0", ",", "enchantLevels", "[", "0", "]", ")", ";", "icrafting", ".", "updateCraftingInventoryInfo", "(", "this", ",", "1", ",", "enchantLevels", "[", "1", "]", ")", ";", "icrafting", ".", "updateCraftingInventoryInfo", "(", "this", ",", "2", ",", "enchantLevels", "[", "2", "]", ")", ";", "}", "}", "public", "void", "onCraftMatrixChanged", "(", "IInventory", "par1IInventory", ")", "{", "if", "(", "par1IInventory", "==", "tableInventory", ")", "{", "ItemStack", "itemstack", "=", "par1IInventory", ".", "getStackInSlot", "(", "0", ")", ";", "if", "(", "itemstack", "==", "null", "||", "!", "itemstack", ".", "isItemEnchantable", "(", ")", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "3", ";", "i", "++", ")", "{", "enchantLevels", "[", "i", "]", "=", "0", ";", "}", "}", "else", "{", "nameSeed", "=", "rand", ".", "nextLong", "(", ")", ";", "if", "(", "!", "worldPointer", ".", "isRemote", ")", "{", "int", "j", "=", "0", ";", "for", "(", "int", "k", "=", "-", "1", ";", "k", "<=", "1", ";", "k", "++", ")", "{", "for", "(", "int", "i1", "=", "-", "1", ";", "i1", "<=", "1", ";", "i1", "++", ")", "{", "if", "(", "k", "==", "0", "&&", "i1", "==", "0", "||", "!", "worldPointer", ".", "isAirBlock", "(", "posX", "+", "i1", ",", "posY", ",", "posZ", "+", "k", ")", "||", "!", "worldPointer", ".", "isAirBlock", "(", "posX", "+", "i1", ",", "posY", "+", "1", ",", "posZ", "+", "k", ")", ")", "{", "continue", ";", "}", "if", "(", "worldPointer", ".", "getBlockId", "(", "posX", "+", "i1", "*", "2", ",", "posY", ",", "posZ", "+", "k", "*", "2", ")", "==", "Block", ".", "bookShelf", ".", "blockID", ")", "{", "j", "++", ";", "}", "if", "(", "worldPointer", ".", "getBlockId", "(", "posX", "+", "i1", "*", "2", ",", "posY", "+", "1", ",", "posZ", "+", "k", "*", "2", ")", "==", "Block", ".", "bookShelf", ".", "blockID", ")", "{", "j", "++", ";", "}", "if", "(", "i1", "==", "0", "||", "k", "==", "0", ")", "{", "continue", ";", "}", "if", "(", "worldPointer", ".", "getBlockId", "(", "posX", "+", "i1", "*", "2", ",", "posY", ",", "posZ", "+", "k", ")", "==", "Block", ".", "bookShelf", ".", "blockID", ")", "{", "j", "++", ";", "}", "if", "(", "worldPointer", ".", "getBlockId", "(", "posX", "+", "i1", "*", "2", ",", "posY", "+", "1", ",", "posZ", "+", "k", ")", "==", "Block", ".", "bookShelf", ".", "blockID", ")", "{", "j", "++", ";", "}", "if", "(", "worldPointer", ".", "getBlockId", "(", "posX", "+", "i1", ",", "posY", ",", "posZ", "+", "k", "*", "2", ")", "==", "Block", ".", "bookShelf", ".", "blockID", ")", "{", "j", "++", ";", "}", "if", "(", "worldPointer", ".", "getBlockId", "(", "posX", "+", "i1", ",", "posY", "+", "1", ",", "posZ", "+", "k", "*", "2", ")", "==", "Block", ".", "bookShelf", ".", "blockID", ")", "{", "j", "++", ";", "}", "}", "}", "for", "(", "int", "l", "=", "0", ";", "l", "<", "3", ";", "l", "++", ")", "{", "enchantLevels", "[", "l", "]", "=", "EnchantmentHelper", ".", "calcItemStackEnchantability", "(", "rand", ",", "l", ",", "j", ",", "itemstack", ")", ";", "}", "updateCraftingResults", "(", ")", ";", "}", "}", "}", "}", "public", "boolean", "enchantItem", "(", "EntityPlayer", "par1EntityPlayer", ",", "int", "par2", ")", "{", "ItemStack", "itemstack", "=", "tableInventory", ".", "getStackInSlot", "(", "0", ")", ";", "if", "(", "enchantLevels", "[", "par2", "]", ">", "0", "&&", "itemstack", "!=", "null", "&&", "(", "par1EntityPlayer", ".", "experienceLevel", ">=", "enchantLevels", "[", "par2", "]", "||", "par1EntityPlayer", ".", "capabilities", ".", "isCreativeMode", ")", ")", "{", "if", "(", "!", "worldPointer", ".", "isRemote", ")", "{", "List", "list", "=", "EnchantmentHelper", ".", "buildEnchantmentList", "(", "rand", ",", "itemstack", ",", "enchantLevels", "[", "par2", "]", ")", ";", "if", "(", "list", "!=", "null", ")", "{", "par1EntityPlayer", ".", "removeExperience", "(", "enchantLevels", "[", "par2", "]", ")", ";", "EnchantmentData", "enchantmentdata", ";", "for", "(", "Iterator", "iterator", "=", "list", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", "itemstack", ".", "addEnchantment", "(", "enchantmentdata", ".", "enchantmentobj", ",", "enchantmentdata", ".", "enchantmentLevel", ")", ")", "{", "enchantmentdata", "=", "(", "EnchantmentData", ")", "iterator", ".", "next", "(", ")", ";", "}", "onCraftMatrixChanged", "(", "tableInventory", ")", ";", "}", "}", "return", "true", ";", "}", "else", "{", "return", "false", ";", "}", "}", "public", "void", "onCraftGuiClosed", "(", "EntityPlayer", "par1EntityPlayer", ")", "{", "super", ".", "onCraftGuiClosed", "(", "par1EntityPlayer", ")", ";", "if", "(", "worldPointer", ".", "isRemote", ")", "{", "return", ";", "}", "ItemStack", "itemstack", "=", "tableInventory", ".", "getStackInSlotOnClosing", "(", "0", ")", ";", "if", "(", "itemstack", "!=", "null", ")", "{", "par1EntityPlayer", ".", "dropPlayerItem", "(", "itemstack", ")", ";", "}", "}", "public", "boolean", "canInteractWith", "(", "EntityPlayer", "par1EntityPlayer", ")", "{", "if", "(", "worldPointer", ".", "getBlockId", "(", "posX", ",", "posY", ",", "posZ", ")", "!=", "Block", ".", "enchantmentTable", ".", "blockID", ")", "{", "return", "false", ";", "}", "return", "par1EntityPlayer", ".", "getDistanceSq", "(", "(", "double", ")", "posX", "+", "0.5D", ",", "(", "double", ")", "posY", "+", "0.5D", ",", "(", "double", ")", "posZ", "+", "0.5D", ")", "<=", "64D", ";", "}", "public", "ItemStack", "transferStackInSlot", "(", "int", "par1", ")", "{", "ItemStack", "itemstack", "=", "null", ";", "Slot", "slot", "=", "(", "Slot", ")", "inventorySlots", ".", "get", "(", "par1", ")", ";", "if", "(", "slot", "!=", "null", "&&", "slot", ".", "getHasStack", "(", ")", ")", "{", "ItemStack", "itemstack1", "=", "slot", ".", "getStack", "(", ")", ";", "itemstack", "=", "itemstack1", ".", "copy", "(", ")", ";", "if", "(", "par1", "==", "0", ")", "{", "if", "(", "!", "mergeItemStack", "(", "itemstack1", ",", "1", ",", "37", ",", "true", ")", ")", "{", "return", "null", ";", "}", "}", "else", "{", "return", "null", ";", "}", "if", "(", "itemstack1", ".", "stackSize", "==", "0", ")", "{", "slot", ".", "putStack", "(", "null", ")", ";", "}", "else", "{", "slot", ".", "onSlotChanged", "(", ")", ";", "}", "if", "(", "itemstack1", ".", "stackSize", "!=", "itemstack", ".", "stackSize", ")", "{", "slot", ".", "onPickupFromSlot", "(", "itemstack1", ")", ";", "}", "else", "{", "return", "null", ";", "}", "}", "return", "itemstack", ";", "}", "}", "</s>" ]
9,926
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "List", ";", "public", "class", "MapInfo", "{", "public", "final", "EntityPlayer", "entityplayerObj", ";", "public", "int", "field_28119_b", "[", "]", ";", "public", "int", "field_28125_c", "[", "]", ";", "private", "int", "field_28123_e", ";", "private", "int", "field_28122_f", ";", "private", "byte", "field_28121_g", "[", "]", ";", "final", "MapData", "mapDataObj", ";", "public", "MapInfo", "(", "MapData", "par1MapData", ",", "EntityPlayer", "par2EntityPlayer", ")", "{", "mapDataObj", "=", "par1MapData", ";", "field_28119_b", "=", "new", "int", "[", "128", "]", ";", "field_28125_c", "=", "new", "int", "[", "128", "]", ";", "field_28123_e", "=", "0", ";", "field_28122_f", "=", "0", ";", "entityplayerObj", "=", "par2EntityPlayer", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "field_28119_b", ".", "length", ";", "i", "++", ")", "{", "field_28119_b", "[", "i", "]", "=", "0", ";", "field_28125_c", "[", "i", "]", "=", "127", ";", "}", "}", "public", "byte", "[", "]", "func_28118_a", "(", "ItemStack", "par1ItemStack", ")", "{", "if", "(", "--", "field_28122_f", "<", "0", ")", "{", "field_28122_f", "=", "4", ";", "byte", "abyte0", "[", "]", "=", "new", "byte", "[", "mapDataObj", ".", "playersVisibleOnMap", ".", "size", "(", ")", "*", "3", "+", "1", "]", ";", "abyte0", "[", "0", "]", "=", "1", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "mapDataObj", ".", "playersVisibleOnMap", ".", "size", "(", ")", ";", "j", "++", ")", "{", "MapCoord", "mapcoord", "=", "(", "MapCoord", ")", "mapDataObj", ".", "playersVisibleOnMap", ".", "get", "(", "j", ")", ";", "abyte0", "[", "j", "*", "3", "+", "1", "]", "=", "(", "byte", ")", "(", "mapcoord", ".", "field_28202_a", "+", "(", "mapcoord", ".", "iconRotation", "&", "0xf", ")", "*", "16", ")", ";", "abyte0", "[", "j", "*", "3", "+", "2", "]", "=", "mapcoord", ".", "centerX", ";", "abyte0", "[", "j", "*", "3", "+", "3", "]", "=", "mapcoord", ".", "centerZ", ";", "}", "boolean", "flag", "=", "true", ";", "if", "(", "field_28121_g", "==", "null", "||", "field_28121_g", ".", "length", "!=", "abyte0", ".", "length", ")", "{", "flag", "=", "false", ";", "}", "else", "{", "int", "l", "=", "0", ";", "do", "{", "if", "(", "l", ">=", "abyte0", ".", "length", ")", "{", "break", ";", "}", "if", "(", "abyte0", "[", "l", "]", "!=", "field_28121_g", "[", "l", "]", ")", "{", "flag", "=", "false", ";", "break", ";", "}", "l", "++", ";", "}", "while", "(", "true", ")", ";", "}", "if", "(", "!", "flag", ")", "{", "field_28121_g", "=", "abyte0", ";", "return", "abyte0", ";", "}", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "10", ";", "i", "++", ")", "{", "int", "k", "=", "(", "field_28123_e", "*", "11", ")", "%", "128", ";", "field_28123_e", "++", ";", "if", "(", "field_28119_b", "[", "k", "]", ">=", "0", ")", "{", "int", "i1", "=", "(", "field_28125_c", "[", "k", "]", "-", "field_28119_b", "[", "k", "]", ")", "+", "1", ";", "int", "j1", "=", "field_28119_b", "[", "k", "]", ";", "byte", "abyte1", "[", "]", "=", "new", "byte", "[", "i1", "+", "3", "]", ";", "abyte1", "[", "0", "]", "=", "0", ";", "abyte1", "[", "1", "]", "=", "(", "byte", ")", "k", ";", "abyte1", "[", "2", "]", "=", "(", "byte", ")", "j1", ";", "for", "(", "int", "k1", "=", "0", ";", "k1", "<", "abyte1", ".", "length", "-", "3", ";", "k1", "++", ")", "{", "abyte1", "[", "k1", "+", "3", "]", "=", "mapDataObj", ".", "colors", "[", "(", "k1", "+", "j1", ")", "*", "128", "+", "k", "]", ";", "}", "field_28125_c", "[", "k", "]", "=", "-", "1", ";", "field_28119_b", "[", "k", "]", "=", "-", "1", ";", "return", "abyte1", ";", "}", "}", "return", "null", ";", "}", "}", "</s>" ]
9,927
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Random", ";", "public", "class", "ComponentMineshaftCorridor", "extends", "StructureComponent", "{", "private", "final", "boolean", "hasRails", ";", "private", "final", "boolean", "hasSpiders", ";", "private", "boolean", "spawnerPlaced", ";", "private", "int", "sectionCount", ";", "public", "ComponentMineshaftCorridor", "(", "int", "par1", ",", "Random", "par2Random", ",", "StructureBoundingBox", "par3StructureBoundingBox", ",", "int", "par4", ")", "{", "super", "(", "par1", ")", ";", "coordBaseMode", "=", "par4", ";", "boundingBox", "=", "par3StructureBoundingBox", ";", "hasRails", "=", "par2Random", ".", "nextInt", "(", "3", ")", "==", "0", ";", "hasSpiders", "=", "!", "hasRails", "&&", "par2Random", ".", "nextInt", "(", "23", ")", "==", "0", ";", "if", "(", "coordBaseMode", "==", "2", "||", "coordBaseMode", "==", "0", ")", "{", "sectionCount", "=", "par3StructureBoundingBox", ".", "getZSize", "(", ")", "/", "5", ";", "}", "else", "{", "sectionCount", "=", "par3StructureBoundingBox", ".", "getXSize", "(", ")", "/", "5", ";", "}", "}", "public", "static", "StructureBoundingBox", "findValidPlacement", "(", "List", "par0List", ",", "Random", "par1Random", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "int", "par5", ")", "{", "StructureBoundingBox", "structureboundingbox", "=", "new", "StructureBoundingBox", "(", "par2", ",", "par3", ",", "par4", ",", "par2", ",", "par3", "+", "2", ",", "par4", ")", ";", "int", "i", "=", "par1Random", ".", "nextInt", "(", "3", ")", "+", "2", ";", "do", "{", "if", "(", "i", "<=", "0", ")", "{", "break", ";", "}", "int", "j", "=", "i", "*", "5", ";", "switch", "(", "par5", ")", "{", "case", "2", ":", "structureboundingbox", ".", "maxX", "=", "par2", "+", "2", ";", "structureboundingbox", ".", "minZ", "=", "par4", "-", "(", "j", "-", "1", ")", ";", "break", ";", "case", "0", ":", "structureboundingbox", ".", "maxX", "=", "par2", "+", "2", ";", "structureboundingbox", ".", "maxZ", "=", "par4", "+", "(", "j", "-", "1", ")", ";", "break", ";", "case", "1", ":", "structureboundingbox", ".", "minX", "=", "par2", "-", "(", "j", "-", "1", ")", ";", "structureboundingbox", ".", "maxZ", "=", "par4", "+", "2", ";", "break", ";", "case", "3", ":", "structureboundingbox", ".", "maxX", "=", "par2", "+", "(", "j", "-", "1", ")", ";", "structureboundingbox", ".", "maxZ", "=", "par4", "+", "2", ";", "break", ";", "}", "if", "(", "StructureComponent", ".", "findIntersecting", "(", "par0List", ",", "structureboundingbox", ")", "==", "null", ")", "{", "break", ";", "}", "i", "--", ";", "}", "while", "(", "true", ")", ";", "if", "(", "i", ">", "0", ")", "{", "return", "structureboundingbox", ";", "}", "else", "{", "return", "null", ";", "}", "}", "public", "void", "buildComponent", "(", "StructureComponent", "par1StructureComponent", ",", "List", "par2List", ",", "Random", "par3Random", ")", "{", "int", "i", "=", "getComponentType", "(", ")", ";", "int", "j", "=", "par3Random", ".", "nextInt", "(", "4", ")", ";", "switch", "(", "coordBaseMode", ")", "{", "case", "2", ":", "if", "(", "j", "<=", "1", ")", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", ",", "(", "boundingBox", ".", "minY", "-", "1", ")", "+", "par3Random", ".", "nextInt", "(", "3", ")", ",", "boundingBox", ".", "minZ", "-", "1", ",", "coordBaseMode", ",", "i", ")", ";", "}", "else", "if", "(", "j", "==", "2", ")", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", "-", "1", ",", "(", "boundingBox", ".", "minY", "-", "1", ")", "+", "par3Random", ".", "nextInt", "(", "3", ")", ",", "boundingBox", ".", "minZ", ",", "1", ",", "i", ")", ";", "}", "else", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "maxX", "+", "1", ",", "(", "boundingBox", ".", "minY", "-", "1", ")", "+", "par3Random", ".", "nextInt", "(", "3", ")", ",", "boundingBox", ".", "minZ", ",", "3", ",", "i", ")", ";", "}", "break", ";", "case", "0", ":", "if", "(", "j", "<=", "1", ")", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", ",", "(", "boundingBox", ".", "minY", "-", "1", ")", "+", "par3Random", ".", "nextInt", "(", "3", ")", ",", "boundingBox", ".", "maxZ", "+", "1", ",", "coordBaseMode", ",", "i", ")", ";", "}", "else", "if", "(", "j", "==", "2", ")", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", "-", "1", ",", "(", "boundingBox", ".", "minY", "-", "1", ")", "+", "par3Random", ".", "nextInt", "(", "3", ")", ",", "boundingBox", ".", "maxZ", "-", "3", ",", "1", ",", "i", ")", ";", "}", "else", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "maxX", "+", "1", ",", "(", "boundingBox", ".", "minY", "-", "1", ")", "+", "par3Random", ".", "nextInt", "(", "3", ")", ",", "boundingBox", ".", "maxZ", "-", "3", ",", "3", ",", "i", ")", ";", "}", "break", ";", "case", "1", ":", "if", "(", "j", "<=", "1", ")", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", "-", "1", ",", "(", "boundingBox", ".", "minY", "-", "1", ")", "+", "par3Random", ".", "nextInt", "(", "3", ")", ",", "boundingBox", ".", "minZ", ",", "coordBaseMode", ",", "i", ")", ";", "}", "else", "if", "(", "j", "==", "2", ")", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", ",", "(", "boundingBox", ".", "minY", "-", "1", ")", "+", "par3Random", ".", "nextInt", "(", "3", ")", ",", "boundingBox", ".", "minZ", "-", "1", ",", "2", ",", "i", ")", ";", "}", "else", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", ",", "(", "boundingBox", ".", "minY", "-", "1", ")", "+", "par3Random", ".", "nextInt", "(", "3", ")", ",", "boundingBox", ".", "maxZ", "+", "1", ",", "0", ",", "i", ")", ";", "}", "break", ";", "case", "3", ":", "if", "(", "j", "<=", "1", ")", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "maxX", "+", "1", ",", "(", "boundingBox", ".", "minY", "-", "1", ")", "+", "par3Random", ".", "nextInt", "(", "3", ")", ",", "boundingBox", ".", "minZ", ",", "coordBaseMode", ",", "i", ")", ";", "}", "else", "if", "(", "j", "==", "2", ")", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "maxX", "-", "3", ",", "(", "boundingBox", ".", "minY", "-", "1", ")", "+", "par3Random", ".", "nextInt", "(", "3", ")", ",", "boundingBox", ".", "minZ", "-", "1", ",", "2", ",", "i", ")", ";", "}", "else", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "maxX", "-", "3", ",", "(", "boundingBox", ".", "minY", "-", "1", ")", "+", "par3Random", ".", "nextInt", "(", "3", ")", ",", "boundingBox", ".", "maxZ", "+", "1", ",", "0", ",", "i", ")", ";", "}", "break", ";", "}", "if", "(", "i", "<", "8", ")", "{", "if", "(", "coordBaseMode", "==", "2", "||", "coordBaseMode", "==", "0", ")", "{", "for", "(", "int", "k", "=", "boundingBox", ".", "minZ", "+", "3", ";", "k", "+", "3", "<=", "boundingBox", ".", "maxZ", ";", "k", "+=", "5", ")", "{", "int", "i1", "=", "par3Random", ".", "nextInt", "(", "5", ")", ";", "if", "(", "i1", "==", "0", ")", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", "-", "1", ",", "boundingBox", ".", "minY", ",", "k", ",", "1", ",", "i", "+", "1", ")", ";", "}", "else", "if", "(", "i1", "==", "1", ")", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "maxX", "+", "1", ",", "boundingBox", ".", "minY", ",", "k", ",", "3", ",", "i", "+", "1", ")", ";", "}", "}", "}", "else", "{", "for", "(", "int", "l", "=", "boundingBox", ".", "minX", "+", "3", ";", "l", "+", "3", "<=", "boundingBox", ".", "maxX", ";", "l", "+=", "5", ")", "{", "int", "j1", "=", "par3Random", ".", "nextInt", "(", "5", ")", ";", "if", "(", "j1", "==", "0", ")", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "l", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "minZ", "-", "1", ",", "2", ",", "i", "+", "1", ")", ";", "continue", ";", "}", "if", "(", "j1", "==", "1", ")", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "l", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "maxZ", "+", "1", ",", "0", ",", "i", "+", "1", ")", ";", "}", "}", "}", "}", "}", "public", "boolean", "addComponentParts", "(", "World", "par1World", ",", "Random", "par2Random", ",", "StructureBoundingBox", "par3StructureBoundingBox", ")", "{", "if", "(", "isLiquidInStructureBoundingBox", "(", "par1World", ",", "par3StructureBoundingBox", ")", ")", "{", "return", "false", ";", "}", "int", "i", "=", "sectionCount", "*", "5", "-", "1", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "0", ",", "0", ",", "0", ",", "2", ",", "1", ",", "i", ",", "0", ",", "0", ",", "false", ")", ";", "randomlyFillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "par2Random", ",", "0.8F", ",", "0", ",", "2", ",", "0", ",", "2", ",", "2", ",", "i", ",", "0", ",", "0", ",", "false", ")", ";", "if", "(", "hasSpiders", ")", "{", "randomlyFillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "par2Random", ",", "0.6F", ",", "0", ",", "0", ",", "0", ",", "2", ",", "1", ",", "i", ",", "Block", ".", "web", ".", "blockID", ",", "0", ",", "false", ")", ";", "}", "for", "(", "int", "j", "=", "0", ";", "j", "<", "sectionCount", ";", "j", "++", ")", "{", "int", "i1", "=", "2", "+", "j", "*", "5", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "0", ",", "0", ",", "i1", ",", "0", ",", "1", ",", "i1", ",", "Block", ".", "fence", ".", "blockID", ",", "0", ",", "false", ")", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "2", ",", "0", ",", "i1", ",", "2", ",", "1", ",", "i1", ",", "Block", ".", "fence", ".", "blockID", ",", "0", ",", "false", ")", ";", "if", "(", "par2Random", ".", "nextInt", "(", "4", ")", "!=", "0", ")", "{", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "0", ",", "2", ",", "i1", ",", "2", ",", "2", ",", "i1", ",", "Block", ".", "planks", ".", "blockID", ",", "0", ",", "false", ")", ";", "}", "else", "{", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "0", ",", "2", ",", "i1", ",", "0", ",", "2", ",", "i1", ",", "Block", ".", "planks", ".", "blockID", ",", "0", ",", "false", ")", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "2", ",", "2", ",", "i1", ",", "2", ",", "2", ",", "i1", ",", "Block", ".", "planks", ".", "blockID", ",", "0", ",", "false", ")", ";", "}", "randomlyPlaceBlock", "(", "par1World", ",", "par3StructureBoundingBox", ",", "par2Random", ",", "0.1F", ",", "0", ",", "2", ",", "i1", "-", "1", ",", "Block", ".", "web", ".", "blockID", ",", "0", ")", ";", "randomlyPlaceBlock", "(", "par1World", ",", "par3StructureBoundingBox", ",", "par2Random", ",", "0.1F", ",", "2", ",", "2", ",", "i1", "-", "1", ",", "Block", ".", "web", ".", "blockID", ",", "0", ")", ";", "randomlyPlaceBlock", "(", "par1World", ",", "par3StructureBoundingBox", ",", "par2Random", ",", "0.1F", ",", "0", ",", "2", ",", "i1", "+", "1", ",", "Block", ".", "web", ".", "blockID", ",", "0", ")", ";", "randomlyPlaceBlock", "(", "par1World", ",", "par3StructureBoundingBox", ",", "par2Random", ",", "0.1F", ",", "2", ",", "2", ",", "i1", "+", "1", ",", "Block", ".", "web", ".", "blockID", ",", "0", ")", ";", "randomlyPlaceBlock", "(", "par1World", ",", "par3StructureBoundingBox", ",", "par2Random", ",", "0.05F", ",", "0", ",", "2", ",", "i1", "-", "2", ",", "Block", ".", "web", ".", "blockID", ",", "0", ")", ";", "randomlyPlaceBlock", "(", "par1World", ",", "par3StructureBoundingBox", ",", "par2Random", ",", "0.05F", ",", "2", ",", "2", ",", "i1", "-", "2", ",", "Block", ".", "web", ".", "blockID", ",", "0", ")", ";", "randomlyPlaceBlock", "(", "par1World", ",", "par3StructureBoundingBox", ",", "par2Random", ",", "0.05F", ",", "0", ",", "2", ",", "i1", "+", "2", ",", "Block", ".", "web", ".", "blockID", ",", "0", ")", ";", "randomlyPlaceBlock", "(", "par1World", ",", "par3StructureBoundingBox", ",", "par2Random", ",", "0.05F", ",", "2", ",", "2", ",", "i1", "+", "2", ",", "Block", ".", "web", ".", "blockID", ",", "0", ")", ";", "randomlyPlaceBlock", "(", "par1World", ",", "par3StructureBoundingBox", ",", "par2Random", ",", "0.05F", ",", "1", ",", "2", ",", "i1", "-", "1", ",", "Block", ".", "torchWood", ".", "blockID", ",", "0", ")", ";", "randomlyPlaceBlock", "(", "par1World", ",", "par3StructureBoundingBox", ",", "par2Random", ",", "0.05F", ",", "1", ",", "2", ",", "i1", "+", "1", ",", "Block", ".", "torchWood", ".", "blockID", ",", "0", ")", ";", "if", "(", "par2Random", ".", "nextInt", "(", "100", ")", "==", "0", ")", "{", "createTreasureChestAtCurrentPosition", "(", "par1World", ",", "par3StructureBoundingBox", ",", "par2Random", ",", "2", ",", "0", ",", "i1", "-", "1", ",", "StructureMineshaftPieces", ".", "getTreasurePieces", "(", ")", ",", "3", "+", "par2Random", ".", "nextInt", "(", "4", ")", ")", ";", "}", "if", "(", "par2Random", ".", "nextInt", "(", "100", ")", "==", "0", ")", "{", "createTreasureChestAtCurrentPosition", "(", "par1World", ",", "par3StructureBoundingBox", ",", "par2Random", ",", "0", ",", "0", ",", "i1", "+", "1", ",", "StructureMineshaftPieces", ".", "getTreasurePieces", "(", ")", ",", "3", "+", "par2Random", ".", "nextInt", "(", "4", ")", ")", ";", "}", "if", "(", "!", "hasSpiders", "||", "spawnerPlaced", ")", "{", "continue", ";", "}", "int", "l1", "=", "getYWithOffset", "(", "0", ")", ";", "int", "j2", "=", "(", "i1", "-", "1", ")", "+", "par2Random", ".", "nextInt", "(", "3", ")", ";", "int", "k2", "=", "getXWithOffset", "(", "1", ",", "j2", ")", ";", "j2", "=", "getZWithOffset", "(", "1", ",", "j2", ")", ";", "if", "(", "!", "par3StructureBoundingBox", ".", "isVecInside", "(", "k2", ",", "l1", ",", "j2", ")", ")", "{", "continue", ";", "}", "spawnerPlaced", "=", "true", ";", "par1World", ".", "setBlockWithNotify", "(", "k2", ",", "l1", ",", "j2", ",", "Block", ".", "mobSpawner", ".", "blockID", ")", ";", "TileEntityMobSpawner", "tileentitymobspawner", "=", "(", "TileEntityMobSpawner", ")", "par1World", ".", "getBlockTileEntity", "(", "k2", ",", "l1", ",", "j2", ")", ";", "if", "(", "tileentitymobspawner", "!=", "null", ")", "{", "tileentitymobspawner", ".", "setMobID", "(", "\"CaveSpider\"", ")", ";", "}", "}", "for", "(", "int", "k", "=", "0", ";", "k", "<=", "2", ";", "k", "++", ")", "{", "for", "(", "int", "j1", "=", "0", ";", "j1", "<=", "i", ";", "j1", "++", ")", "{", "int", "i2", "=", "getBlockIdAtCurrentPosition", "(", "par1World", ",", "k", ",", "-", "1", ",", "j1", ",", "par3StructureBoundingBox", ")", ";", "if", "(", "i2", "==", "0", ")", "{", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "planks", ".", "blockID", ",", "0", ",", "k", ",", "-", "1", ",", "j1", ",", "par3StructureBoundingBox", ")", ";", "}", "}", "}", "if", "(", "hasRails", ")", "{", "for", "(", "int", "l", "=", "0", ";", "l", "<=", "i", ";", "l", "++", ")", "{", "int", "k1", "=", "getBlockIdAtCurrentPosition", "(", "par1World", ",", "1", ",", "-", "1", ",", "l", ",", "par3StructureBoundingBox", ")", ";", "if", "(", "k1", ">", "0", "&&", "Block", ".", "opaqueCubeLookup", "[", "k1", "]", ")", "{", "randomlyPlaceBlock", "(", "par1World", ",", "par3StructureBoundingBox", ",", "par2Random", ",", "0.7F", ",", "1", ",", "0", ",", "l", ",", "Block", ".", "rail", ".", "blockID", ",", "getMetadataWithOffset", "(", "Block", ".", "rail", ".", "blockID", ",", "0", ")", ")", ";", "}", "}", "}", "return", "true", ";", "}", "}", "</s>" ]
9,928
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "TileEntityNote", "extends", "TileEntity", "{", "public", "byte", "note", ";", "public", "boolean", "previousRedstoneState", ";", "public", "TileEntityNote", "(", ")", "{", "note", "=", "0", ";", "previousRedstoneState", "=", "false", ";", "}", "public", "void", "writeToNBT", "(", "NBTTagCompound", "par1NBTTagCompound", ")", "{", "super", ".", "writeToNBT", "(", "par1NBTTagCompound", ")", ";", "par1NBTTagCompound", ".", "setByte", "(", "\"note\"", ",", "note", ")", ";", "}", "public", "void", "readFromNBT", "(", "NBTTagCompound", "par1NBTTagCompound", ")", "{", "super", ".", "readFromNBT", "(", "par1NBTTagCompound", ")", ";", "note", "=", "par1NBTTagCompound", ".", "getByte", "(", "\"note\"", ")", ";", "if", "(", "note", "<", "0", ")", "{", "note", "=", "0", ";", "}", "if", "(", "note", ">", "24", ")", "{", "note", "=", "24", ";", "}", "}", "public", "void", "changePitch", "(", ")", "{", "note", "=", "(", "byte", ")", "(", "(", "note", "+", "1", ")", "%", "25", ")", ";", "onInventoryChanged", "(", ")", ";", "}", "public", "void", "triggerNote", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "if", "(", "par1World", ".", "getBlockMaterial", "(", "par2", ",", "par3", "+", "1", ",", "par4", ")", "!=", "Material", ".", "air", ")", "{", "return", ";", "}", "Material", "material", "=", "par1World", ".", "getBlockMaterial", "(", "par2", ",", "par3", "-", "1", ",", "par4", ")", ";", "byte", "byte0", "=", "0", ";", "if", "(", "material", "==", "Material", ".", "rock", ")", "{", "byte0", "=", "1", ";", "}", "if", "(", "material", "==", "Material", ".", "sand", ")", "{", "byte0", "=", "2", ";", "}", "if", "(", "material", "==", "Material", ".", "glass", ")", "{", "byte0", "=", "3", ";", "}", "if", "(", "material", "==", "Material", ".", "wood", ")", "{", "byte0", "=", "4", ";", "}", "par1World", ".", "playNoteAt", "(", "par2", ",", "par3", ",", "par4", ",", "byte0", ",", "note", ")", ";", "}", "}", "</s>" ]
9,929
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "EnchantmentArrowDamage", "extends", "Enchantment", "{", "public", "EnchantmentArrowDamage", "(", "int", "par1", ",", "int", "par2", ")", "{", "super", "(", "par1", ",", "par2", ",", "EnumEnchantmentType", ".", "bow", ")", ";", "setName", "(", "\"arrowDamage\"", ")", ";", "}", "public", "int", "getMinEnchantability", "(", "int", "par1", ")", "{", "return", "1", "+", "(", "par1", "-", "1", ")", "*", "10", ";", "}", "public", "int", "getMaxEnchantability", "(", "int", "par1", ")", "{", "return", "getMinEnchantability", "(", "par1", ")", "+", "15", ";", "}", "public", "int", "getMaxLevel", "(", ")", "{", "return", "5", ";", "}", "}", "</s>" ]
9,930
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "io", ".", "PrintStream", ";", "import", "java", ".", "util", ".", "Random", ";", "public", "class", "Item", "{", "protected", "static", "Random", "itemRand", "=", "new", "Random", "(", ")", ";", "public", "static", "Item", "itemsList", "[", "]", "=", "new", "Item", "[", "32000", "]", ";", "public", "static", "Item", "shovelSteel", ";", "public", "static", "Item", "pickaxeSteel", ";", "public", "static", "Item", "axeSteel", ";", "public", "static", "Item", "flintAndSteel", "=", "(", "new", "ItemFlintAndSteel", "(", "3", ")", ")", ".", "setIconCoord", "(", "5", ",", "0", ")", ".", "setItemName", "(", "\"\"", ")", ";", "public", "static", "Item", "appleRed", "=", "(", "new", "ItemFood", "(", "4", ",", "4", ",", "0.3F", ",", "false", ")", ")", ".", "setIconCoord", "(", "10", ",", "0", ")", ".", "setItemName", "(", "\"apple\"", ")", ";", "public", "static", "Item", "bow", "=", "(", "new", "ItemBow", "(", "5", ")", ")", ".", "setIconCoord", "(", "5", ",", "1", ")", ".", "setItemName", "(", "\"bow\"", ")", ";", "public", "static", "Item", "arrow", "=", "(", "new", "Item", "(", "6", ")", ")", ".", "setIconCoord", "(", "5", ",", "2", ")", ".", "setItemName", "(", "\"arrow\"", ")", ";", "public", "static", "Item", "coal", "=", "(", "new", "ItemCoal", "(", "7", ")", ")", ".", "setIconCoord", "(", "7", ",", "0", ")", ".", "setItemName", "(", "\"coal\"", ")", ";", "public", "static", "Item", "diamond", "=", "(", "new", "Item", "(", "8", ")", ")", ".", "setIconCoord", "(", "7", ",", "3", ")", ".", "setItemName", "(", "\"emerald\"", ")", ";", "public", "static", "Item", "ingotIron", "=", "(", "new", "Item", "(", "9", ")", ")", ".", "setIconCoord", "(", "7", ",", "1", ")", ".", "setItemName", "(", "\"ingotIron\"", ")", ";", "public", "static", "Item", "ingotGold", "=", "(", "new", "Item", "(", "10", ")", ")", ".", "setIconCoord", "(", "7", ",", "2", ")", ".", "setItemName", "(", "\"ingotGold\"", ")", ";", "public", "static", "Item", "swordSteel", ";", "public", "static", "Item", "swordWood", ";", "public", "static", "Item", "shovelWood", ";", "public", "static", "Item", "pickaxeWood", ";", "public", "static", "Item", "axeWood", ";", "public", "static", "Item", "swordStone", ";", "public", "static", "Item", "shovelStone", ";", "public", "static", "Item", "pickaxeStone", ";", "public", "static", "Item", "axeStone", ";", "public", "static", "Item", "swordDiamond", ";", "public", "static", "Item", "shovelDiamond", ";", "public", "static", "Item", "pickaxeDiamond", ";", "public", "static", "Item", "axeDiamond", ";", "public", "static", "Item", "stick", "=", "(", "new", "Item", "(", "24", ")", ")", ".", "setIconCoord", "(", "5", ",", "3", ")", ".", "setFull3D", "(", ")", ".", "setItemName", "(", "\"stick\"", ")", ";", "public", "static", "Item", "bowlEmpty", "=", "(", "new", "Item", "(", "25", ")", ")", ".", "setIconCoord", "(", "7", ",", "4", ")", ".", "setItemName", "(", "\"bowl\"", ")", ";", "public", "static", "Item", "bowlSoup", "=", "(", "new", "ItemSoup", "(", "26", ",", "8", ")", ")", ".", "setIconCoord", "(", "8", ",", "4", ")", ".", "setItemName", "(", "\"mushroomStew\"", ")", ";", "public", "static", "Item", "swordGold", ";", "public", "static", "Item", "shovelGold", ";", "public", "static", "Item", "pickaxeGold", ";", "public", "static", "Item", "axeGold", ";", "public", "static", "Item", "silk", "=", "(", "new", "Item", "(", "31", ")", ")", ".", "setIconCoord", "(", "8", ",", "0", ")", ".", "setItemName", "(", "\"string\"", ")", ";", "public", "static", "Item", "feather", "=", "(", "new", "Item", "(", "32", ")", ")", ".", "setIconCoord", "(", "8", ",", "1", ")", ".", "setItemName", "(", "\"feather\"", ")", ";", "public", "static", "Item", "gunpowder", ";", "public", "static", "Item", "hoeWood", ";", "public", "static", "Item", "hoeStone", ";", "public", "static", "Item", "hoeSteel", ";", "public", "static", "Item", "hoeDiamond", ";", "public", "static", "Item", "hoeGold", ";", "public", "static", "Item", "seeds", ";", "public", "static", "Item", "wheat", "=", "(", "new", "Item", "(", "40", ")", ")", ".", "setIconCoord", "(", "9", ",", "1", ")", ".", "setItemName", "(", "\"wheat\"", ")", ";", "public", "static", "Item", "bread", "=", "(", "new", "ItemFood", "(", "41", ",", "5", ",", "0.6F", ",", "false", ")", ")", ".", "setIconCoord", "(", "9", ",", "2", ")", ".", "setItemName", "(", "\"bread\"", ")", ";", "public", "static", "Item", "helmetLeather", ";", "public", "static", "Item", "plateLeather", ";", "public", "static", "Item", "legsLeather", ";", "public", "static", "Item", "bootsLeather", ";", "public", "static", "Item", "helmetChain", ";", "public", "static", "Item", "plateChain", ";", "public", "static", "Item", "legsChain", ";", "public", "static", "Item", "bootsChain", ";", "public", "static", "Item", "helmetSteel", ";", "public", "static", "Item", "plateSteel", ";", "public", "static", "Item", "legsSteel", ";", "public", "static", "Item", "bootsSteel", ";", "public", "static", "Item", "helmetDiamond", ";", "public", "static", "Item", "plateDiamond", ";", "public", "static", "Item", "legsDiamond", ";", "public", "static", "Item", "bootsDiamond", ";", "public", "static", "Item", "helmetGold", ";", "public", "static", "Item", "plateGold", ";", "public", "static", "Item", "legsGold", ";", "public", "static", "Item", "bootsGold", ";", "public", "static", "Item", "flint", "=", "(", "new", "Item", "(", "62", ")", ")", ".", "setIconCoord", "(", "6", ",", "0", ")", ".", "setItemName", "(", "\"flint\"", ")", ";", "public", "static", "Item", "porkRaw", "=", "(", "new", "ItemFood", "(", "63", ",", "3", ",", "0.3F", ",", "true", ")", ")", ".", "setIconCoord", "(", "7", ",", "5", ")", ".", "setItemName", "(", "\"porkchopRaw\"", ")", ";", "public", "static", "Item", "porkCooked", "=", "(", "new", "ItemFood", "(", "64", ",", "8", ",", "0.8F", ",", "true", ")", ")", ".", "setIconCoord", "(", "8", ",", "5", ")", ".", "setItemName", "(", "\"\"", ")", ";", "public", "static", "Item", "painting", "=", "(", "new", "ItemPainting", "(", "65", ")", ")", ".", "setIconCoord", "(", "10", ",", "1", ")", ".", "setItemName", "(", "\"painting\"", ")", ";", "public", "static", "Item", "appleGold", ";", "public", "static", "Item", "sign", "=", "(", "new", "ItemSign", "(", "67", ")", ")", ".", "setIconCoord", "(", "10", ",", "2", ")", ".", "setItemName", "(", "\"sign\"", ")", ";", "public", "static", "Item", "doorWood", ";", "public", "static", "Item", "bucketEmpty", ";", "public", "static", "Item", "bucketWater", ";", "public", "static", "Item", "bucketLava", ";", "public", "static", "Item", "minecartEmpty", "=", "(", "new", "ItemMinecart", "(", "72", ",", "0", ")", ")", ".", "setIconCoord", "(", "7", ",", "8", ")", ".", "setItemName", "(", "\"minecart\"", ")", ";", "public", "static", "Item", "saddle", "=", "(", "new", "ItemSaddle", "(", "73", ")", ")", ".", "setIconCoord", "(", "8", ",", "6", ")", ".", "setItemName", "(", "\"saddle\"", ")", ";", "public", "static", "Item", "doorSteel", ";", "public", "static", "Item", "redstone", ";", "public", "static", "Item", "snowball", "=", "(", "new", "ItemSnowball", "(", "76", ")", ")", ".", "setIconCoord", "(", "14", ",", "0", ")", ".", "setItemName", "(", "\"snowball\"", ")", ";", "public", "static", "Item", "boat", "=", "(", "new", "ItemBoat", "(", "77", ")", ")", ".", "setIconCoord", "(", "8", ",", "8", ")", ".", "setItemName", "(", "\"boat\"", ")", ";", "public", "static", "Item", "leather", "=", "(", "new", "Item", "(", "78", ")", ")", ".", "setIconCoord", "(", "7", ",", "6", ")", ".", "setItemName", "(", "\"leather\"", ")", ";", "public", "static", "Item", "bucketMilk", ";", "public", "static", "Item", "brick", "=", "(", "new", "Item", "(", "80", ")", ")", ".", "setIconCoord", "(", "6", ",", "1", ")", ".", "setItemName", "(", "\"brick\"", ")", ";", "public", "static", "Item", "clay", "=", "(", "new", "Item", "(", "81", ")", ")", ".", "setIconCoord", "(", "9", ",", "3", ")", ".", "setItemName", "(", "\"clay\"", ")", ";", "public", "static", "Item", "reed", ";", "public", "static", "Item", "paper", "=", "(", "new", "Item", "(", "83", ")", ")", ".", "setIconCoord", "(", "10", ",", "3", ")", ".", "setItemName", "(", "\"paper\"", ")", ";", "public", "static", "Item", "book", "=", "(", "new", "Item", "(", "84", ")", ")", ".", "setIconCoord", "(", "11", ",", "3", ")", ".", "setItemName", "(", "\"book\"", ")", ";", "public", "static", "Item", "slimeBall", "=", "(", "new", "Item", "(", "85", ")", ")", ".", "setIconCoord", "(", "14", ",", "1", ")", ".", "setItemName", "(", "\"slimeball\"", ")", ";", "public", "static", "Item", "minecartCrate", "=", "(", "new", "ItemMinecart", "(", "86", ",", "1", ")", ")", ".", "setIconCoord", "(", "7", ",", "9", ")", ".", "setItemName", "(", "\"\"", ")", ";", "public", "static", "Item", "minecartPowered", "=", "(", "new", "ItemMinecart", "(", "87", ",", "2", ")", ")", ".", "setIconCoord", "(", "7", ",", "10", ")", ".", "setItemName", "(", "\"\"", ")", ";", "public", "static", "Item", "egg", "=", "(", "new", "ItemEgg", "(", "88", ")", ")", ".", "setIconCoord", "(", "12", ",", "0", ")", ".", "setItemName", "(", "\"egg\"", ")", ";", "public", "static", "Item", "compass", "=", "(", "new", "Item", "(", "89", ")", ")", ".", "setIconCoord", "(", "6", ",", "3", ")", ".", "setItemName", "(", "\"compass\"", ")", ";", "public", "static", "Item", "fishingRod", "=", "(", "new", "ItemFishingRod", "(", "90", ")", ")", ".", "setIconCoord", "(", "5", ",", "4", ")", ".", "setItemName", "(", "\"fishingRod\"", ")", ";", "public", "static", "Item", "pocketSundial", "=", "(", "new", "Item", "(", "91", ")", ")", ".", "setIconCoord", "(", "6", ",", "4", ")", ".", "setItemName", "(", "\"clock\"", ")", ";", "public", "static", "Item", "lightStoneDust", ";", "public", "static", "Item", "fishRaw", "=", "(", "new", "ItemFood", "(", "93", ",", "2", ",", "0.3F", ",", "false", ")", ")", ".", "setIconCoord", "(", "9", ",", "5", ")", ".", "setItemName", "(", "\"fishRaw\"", ")", ";", "public", "static", "Item", "fishCooked", "=", "(", "new", "ItemFood", "(", "94", ",", "5", ",", "0.6F", ",", "false", ")", ")", ".", "setIconCoord", "(", "10", ",", "5", ")", ".", "setItemName", "(", "\"fishCooked\"", ")", ";", "public", "static", "Item", "dyePowder", "=", "(", "new", "ItemDye", "(", "95", ")", ")", ".", "setIconCoord", "(", "14", ",", "4", ")", ".", "setItemName", "(", "\"dyePowder\"", ")", ";", "public", "static", "Item", "bone", "=", "(", "new", "Item", "(", "96", ")", ")", ".", "setIconCoord", "(", "12", ",", "1", ")", ".", "setItemName", "(", "\"bone\"", ")", ".", "setFull3D", "(", ")", ";", "public", "static", "Item", "sugar", ";", "public", "static", "Item", "cake", ";", "public", "static", "Item", "bed", "=", "(", "new", "ItemBed", "(", "99", ")", ")", ".", "setMaxStackSize", "(", "1", ")", ".", "setIconCoord", "(", "13", ",", "2", ")", ".", "setItemName", "(", "\"bed\"", ")", ";", "public", "static", "Item", "redstoneRepeater", ";", "public", "static", "Item", "cookie", "=", "(", "new", "ItemFood", "(", "101", ",", "1", ",", "0.1F", ",", "false", ")", ")", ".", "setIconCoord", "(", "12", ",", "5", ")", ".", "setItemName", "(", "\"cookie\"", ")", ";", "public", "static", "ItemMap", "map", "=", "(", "ItemMap", ")", "(", "new", "ItemMap", "(", "102", ")", ")", ".", "setIconCoord", "(", "12", ",", "3", ")", ".", "setItemName", "(", "\"map\"", ")", ";", "public", "static", "ItemShears", "shears", "=", "(", "ItemShears", ")", "(", "new", "ItemShears", "(", "103", ")", ")", ".", "setIconCoord", "(", "13", ",", "5", ")", ".", "setItemName", "(", "\"shears\"", ")", ";", "public", "static", "Item", "melon", "=", "(", "new", "ItemFood", "(", "104", ",", "2", ",", "0.3F", ",", "false", ")", ")", ".", "setIconCoord", "(", "13", ",", "6", ")", ".", "setItemName", "(", "\"melon\"", ")", ";", "public", "static", "Item", "pumpkinSeeds", ";", "public", "static", "Item", "melonSeeds", ";", "public", "static", "Item", "beefRaw", "=", "(", "new", "ItemFood", "(", "107", ",", "3", ",", "0.3F", ",", "true", ")", ")", ".", "setIconCoord", "(", "9", ",", "6", ")", ".", "setItemName", "(", "\"beefRaw\"", ")", ";", "public", "static", "Item", "beefCooked", "=", "(", "new", "ItemFood", "(", "108", ",", "8", ",", "0.8F", ",", "true", ")", ")", ".", "setIconCoord", "(", "10", ",", "6", ")", ".", "setItemName", "(", "\"beefCooked\"", ")", ";", "public", "static", "Item", "chickenRaw", ";", "public", "static", "Item", "chickenCooked", "=", "(", "new", "ItemFood", "(", "110", ",", "6", ",", "0.6F", ",", "true", ")", ")", ".", "setIconCoord", "(", "10", ",", "7", ")", ".", "setItemName", "(", "\"\"", ")", ";", "public", "static", "Item", "rottenFlesh", ";", "public", "static", "Item", "enderPearl", "=", "(", "new", "ItemEnderPearl", "(", "112", ")", ")", ".", "setIconCoord", "(", "11", ",", "6", ")", ".", "setItemName", "(", "\"enderPearl\"", ")", ";", "public", "static", "Item", "blazeRod", "=", "(", "new", "Item", "(", "113", ")", ")", ".", "setIconCoord", "(", "12", ",", "6", ")", ".", "setItemName", "(", "\"blazeRod\"", ")", ";", "public", "static", "Item", "ghastTear", ";", "public", "static", "Item", "goldNugget", "=", "(", "new", "Item", "(", "115", ")", ")", ".", "setIconCoord", "(", "12", ",", "7", ")", ".", "setItemName", "(", "\"goldNugget\"", ")", ";", "public", "static", "Item", "netherStalkSeeds", ";", "public", "static", "ItemPotion", "potion", "=", "(", "ItemPotion", ")", "(", "new", "ItemPotion", "(", "117", ")", ")", ".", "setIconCoord", "(", "13", ",", "8", ")", ".", "setItemName", "(", "\"potion\"", ")", ";", "public", "static", "Item", "glassBottle", "=", "(", "new", "ItemGlassBottle", "(", "118", ")", ")", ".", "setIconCoord", "(", "12", ",", "8", ")", ".", "setItemName", "(", "\"glassBottle\"", ")", ";", "public", "static", "Item", "spiderEye", ";", "public", "static", "Item", "fermentedSpiderEye", ";", "public", "static", "Item", "blazePowder", ";", "public", "static", "Item", "magmaCream", ";", "public", "static", "Item", "brewingStand", ";", "public", "static", "Item", "cauldron", ";", "public", "static", "Item", "eyeOfEnder", "=", "(", "new", "ItemEnderEye", "(", "125", ")", ")", ".", "setIconCoord", "(", "11", ",", "9", ")", ".", "setItemName", "(", "\"eyeOfEnder\"", ")", ";", "public", "static", "Item", "speckledMelon", ";", "public", "static", "Item", "monsterPlacer", "=", "(", "new", "ItemMonsterPlacer", "(", "127", ")", ")", ".", "setIconCoord", "(", "9", ",", "9", ")", ".", "setItemName", "(", "\"\"", ")", ";", "public", "static", "Item", "expBottle", "=", "(", "new", "ItemExpBottle", "(", "128", ")", ")", ".", "setIconCoord", "(", "11", ",", "10", ")", ".", "setItemName", "(", "\"expBottle\"", ")", ";", "public", "static", "Item", "fireballCharge", "=", "(", "new", "ItemFireball", "(", "129", ")", ")", ".", "setIconCoord", "(", "14", ",", "2", ")", ".", "setItemName", "(", "\"fireball\"", ")", ";", "public", "static", "Item", "record13", "=", "(", "new", "ItemRecord", "(", "2000", ",", "\"13\"", ")", ")", ".", "setIconCoord", "(", "0", ",", "15", ")", ".", "setItemName", "(", "\"record\"", ")", ";", "public", "static", "Item", "recordCat", "=", "(", "new", "ItemRecord", "(", "2001", ",", "\"cat\"", ")", ")", ".", "setIconCoord", "(", "1", ",", "15", ")", ".", "setItemName", "(", "\"record\"", ")", ";", "public", "static", "Item", "recordBlocks", "=", "(", "new", "ItemRecord", "(", "2002", ",", "\"blocks\"", ")", ")", ".", "setIconCoord", "(", "2", ",", "15", ")", ".", "setItemName", "(", "\"record\"", ")", ";", "public", "static", "Item", "recordChirp", "=", "(", "new", "ItemRecord", "(", "2003", ",", "\"chirp\"", ")", ")", ".", "setIconCoord", "(", "3", ",", "15", ")", ".", "setItemName", "(", "\"record\"", ")", ";", "public", "static", "Item", "recordFar", "=", "(", "new", "ItemRecord", "(", "2004", ",", "\"far\"", ")", ")", ".", "setIconCoord", "(", "4", ",", "15", ")", ".", "setItemName", "(", "\"record\"", ")", ";", "public", "static", "Item", "recordMall", "=", "(", "new", "ItemRecord", "(", "2005", ",", "\"mall\"", ")", ")", ".", "setIconCoord", "(", "5", ",", "15", ")", ".", "setItemName", "(", "\"record\"", ")", ";", "public", "static", "Item", "recordMellohi", "=", "(", "new", "ItemRecord", "(", "2006", ",", "\"mellohi\"", ")", ")", ".", "setIconCoord", "(", "6", ",", "15", ")", ".", "setItemName", "(", "\"record\"", ")", ";", "public", "static", "Item", "recordStal", "=", "(", "new", "ItemRecord", "(", "2007", ",", "\"stal\"", ")", ")", ".", "setIconCoord", "(", "7", ",", "15", ")", ".", "setItemName", "(", "\"record\"", ")", ";", "public", "static", "Item", "recordStrad", "=", "(", "new", "ItemRecord", "(", "2008", ",", "\"strad\"", ")", ")", ".", "setIconCoord", "(", "8", ",", "15", ")", ".", "setItemName", "(", "\"record\"", ")", ";", "public", "static", "Item", "recordWard", "=", "(", "new", "ItemRecord", "(", "2009", ",", "\"ward\"", ")", ")", ".", "setIconCoord", "(", "9", ",", "15", ")", ".", "setItemName", "(", "\"record\"", ")", ";", "public", "static", "Item", "record11", "=", "(", "new", "ItemRecord", "(", "2010", ",", "\"11\"", ")", ")", ".", "setIconCoord", "(", "10", ",", "15", ")", ".", "setItemName", "(", "\"record\"", ")", ";", "public", "final", "int", "shiftedIndex", ";", "protected", "int", "maxStackSize", ";", "private", "int", "maxDamage", ";", "protected", "int", "iconIndex", ";", "protected", "boolean", "bFull3D", ";", "protected", "boolean", "hasSubtypes", ";", "private", "Item", "containerItem", ";", "private", "String", "potionEffect", ";", "private", "String", "itemName", ";", "protected", "Item", "(", "int", "par1", ")", "{", "maxStackSize", "=", "64", ";", "maxDamage", "=", "0", ";", "bFull3D", "=", "false", ";", "hasSubtypes", "=", "false", ";", "containerItem", "=", "null", ";", "potionEffect", "=", "null", ";", "shiftedIndex", "=", "256", "+", "par1", ";", "if", "(", "itemsList", "[", "256", "+", "par1", "]", "!=", "null", ")", "{", "System", ".", "out", ".", "println", "(", "(", "new", "StringBuilder", "(", ")", ")", ".", "append", "(", "\"CONFLICT", "@", "\"", ")", ".", "append", "(", "par1", ")", ".", "toString", "(", ")", ")", ";", "}", "itemsList", "[", "256", "+", "par1", "]", "=", "this", ";", "}", "public", "Item", "setIconIndex", "(", "int", "par1", ")", "{", "iconIndex", "=", "par1", ";", "return", "this", ";", "}", "public", "Item", "setMaxStackSize", "(", "int", "par1", ")", "{", "maxStackSize", "=", "par1", ";", "return", "this", ";", "}", "public", "Item", "setIconCoord", "(", "int", "par1", ",", "int", "par2", ")", "{", "iconIndex", "=", "par1", "+", "par2", "*", "16", ";", "return", "this", ";", "}", "public", "boolean", "onItemUse", "(", "ItemStack", "par1ItemStack", ",", "EntityPlayer", "par2EntityPlayer", ",", "World", "par3World", ",", "int", "i", ",", "int", "j", ",", "int", "k", ",", "int", "l", ")", "{", "return", "false", ";", "}", "public", "float", "getStrVsBlock", "(", "ItemStack", "par1ItemStack", ",", "Block", "par2Block", ")", "{", "return", "1.0F", ";", "}", "public", "ItemStack", "onItemRightClick", "(", "ItemStack", "par1ItemStack", ",", "World", "par2World", ",", "EntityPlayer", "par3EntityPlayer", ")", "{", "return", "par1ItemStack", ";", "}", "public", "ItemStack", "onFoodEaten", "(", "ItemStack", "par1ItemStack", ",", "World", "par2World", ",", "EntityPlayer", "par3EntityPlayer", ")", "{", "return", "par1ItemStack", ";", "}", "public", "int", "getItemStackLimit", "(", ")", "{", "return", "maxStackSize", ";", "}", "public", "int", "getMetadata", "(", "int", "par1", ")", "{", "return", "0", ";", "}", "public", "boolean", "getHasSubtypes", "(", ")", "{", "return", "hasSubtypes", ";", "}", "protected", "Item", "setHasSubtypes", "(", "boolean", "par1", ")", "{", "hasSubtypes", "=", "par1", ";", "return", "this", ";", "}", "public", "int", "getMaxDamage", "(", ")", "{", "return", "maxDamage", ";", "}", "protected", "Item", "setMaxDamage", "(", "int", "par1", ")", "{", "maxDamage", "=", "par1", ";", "return", "this", ";", "}", "public", "boolean", "isDamageable", "(", ")", "{", "return", "maxDamage", ">", "0", "&&", "!", "hasSubtypes", ";", "}", "public", "boolean", "hitEntity", "(", "ItemStack", "par1ItemStack", ",", "EntityLiving", "par2EntityLiving", ",", "EntityLiving", "par3EntityLiving", ")", "{", "return", "false", ";", "}", "public", "boolean", "onBlockDestroyed", "(", "ItemStack", "par1ItemStack", ",", "int", "par2", ",", "int", "par3", ",", "int", "i", ",", "int", "j", ",", "EntityLiving", "entityliving", ")", "{", "return", "false", ";", "}", "public", "int", "getDamageVsEntity", "(", "Entity", "par1Entity", ")", "{", "return", "1", ";", "}", "public", "boolean", "canHarvestBlock", "(", "Block", "par1Block", ")", "{", "return", "false", ";", "}", "public", "void", "useItemOnEntity", "(", "ItemStack", "itemstack", ",", "EntityLiving", "entityliving", ")", "{", "}", "public", "Item", "setFull3D", "(", ")", "{", "bFull3D", "=", "true", ";", "return", "this", ";", "}", "public", "Item", "setItemName", "(", "String", "par1Str", ")", "{", "itemName", "=", "(", "new", "StringBuilder", "(", ")", ")", ".", "append", "(", "\"item.\"", ")", ".", "append", "(", "par1Str", ")", ".", "toString", "(", ")", ";", "return", "this", ";", "}", "public", "String", "getItemName", "(", ")", "{", "return", "itemName", ";", "}", "public", "String", "getItemNameIS", "(", "ItemStack", "par1ItemStack", ")", "{", "return", "itemName", ";", "}", "public", "Item", "setContainerItem", "(", "Item", "par1Item", ")", "{", "containerItem", "=", "par1Item", ";", "return", "this", ";", "}", "public", "boolean", "doesContainerItemLeaveCraftingGrid", "(", "ItemStack", "par1ItemStack", ")", "{", "return", "true", ";", "}", "public", "boolean", "func_46003_i", "(", ")", "{", "return", "false", ";", "}", "public", "Item", "getContainerItem", "(", ")", "{", "return", "containerItem", ";", "}", "public", "boolean", "hasContainerItem", "(", ")", "{", "return", "containerItem", "!=", "null", ";", "}", "public", "String", "getStatName", "(", ")", "{", "return", "StatCollector", ".", "translateToLocal", "(", "(", "new", "StringBuilder", "(", ")", ")", ".", "append", "(", "getItemName", "(", ")", ")", ".", "append", "(", "\".name\"", ")", ".", "toString", "(", ")", ")", ";", "}", "public", "void", "onUpdate", "(", "ItemStack", "itemstack", ",", "World", "world", ",", "Entity", "entity", ",", "int", "i", ",", "boolean", "flag", ")", "{", "}", "public", "void", "onCreated", "(", "ItemStack", "itemstack", ",", "World", "world", ",", "EntityPlayer", "entityplayer", ")", "{", "}", "public", "boolean", "func_28019_b", "(", ")", "{", "return", "false", ";", "}", "public", "EnumAction", "getItemUseAction", "(", "ItemStack", "par1ItemStack", ")", "{", "return", "EnumAction", ".", "none", ";", "}", "public", "int", "getMaxItemUseDuration", "(", "ItemStack", "par1ItemStack", ")", "{", "return", "0", ";", "}", "public", "void", "onPlayerStoppedUsing", "(", "ItemStack", "itemstack", ",", "World", "world", ",", "EntityPlayer", "entityplayer", ",", "int", "i", ")", "{", "}", "protected", "Item", "setPotionEffect", "(", "String", "par1Str", ")", "{", "potionEffect", "=", "par1Str", ";", "return", "this", ";", "}", "public", "String", "getPotionEffect", "(", ")", "{", "return", "potionEffect", ";", "}", "public", "boolean", "isPotionIngredient", "(", ")", "{", "return", "potionEffect", "!=", "null", ";", "}", "public", "boolean", "isItemTool", "(", "ItemStack", "par1ItemStack", ")", "{", "return", "getItemStackLimit", "(", ")", "==", "1", "&&", "isDamageable", "(", ")", ";", "}", "protected", "MovingObjectPosition", "getMovingObjectPositionFromPlayer", "(", "World", "par1World", ",", "EntityPlayer", "par2EntityPlayer", ",", "boolean", "par3", ")", "{", "float", "f", "=", "1.0F", ";", "float", "f1", "=", "par2EntityPlayer", ".", "prevRotationPitch", "+", "(", "par2EntityPlayer", ".", "rotationPitch", "-", "par2EntityPlayer", ".", "prevRotationPitch", ")", "*", "f", ";", "float", "f2", "=", "par2EntityPlayer", ".", "prevRotationYaw", "+", "(", "par2EntityPlayer", ".", "rotationYaw", "-", "par2EntityPlayer", ".", "prevRotationYaw", ")", "*", "f", ";", "double", "d", "=", "par2EntityPlayer", ".", "prevPosX", "+", "(", "par2EntityPlayer", ".", "posX", "-", "par2EntityPlayer", ".", "prevPosX", ")", "*", "(", "double", ")", "f", ";", "double", "d1", "=", "(", "par2EntityPlayer", ".", "prevPosY", "+", "(", "par2EntityPlayer", ".", "posY", "-", "par2EntityPlayer", ".", "prevPosY", ")", "*", "(", "double", ")", "f", "+", "1.6200000000000001D", ")", "-", "(", "double", ")", "par2EntityPlayer", ".", "yOffset", ";", "double", "d2", "=", "par2EntityPlayer", ".", "prevPosZ", "+", "(", "par2EntityPlayer", ".", "posZ", "-", "par2EntityPlayer", ".", "prevPosZ", ")", "*", "(", "double", ")", "f", ";", "Vec3D", "vec3d", "=", "Vec3D", ".", "createVector", "(", "d", ",", "d1", ",", "d2", ")", ";", "float", "f3", "=", "MathHelper", ".", "cos", "(", "-", "f2", "*", "0.01745329F", "-", "(", "float", ")", "Math", ".", "PI", ")", ";", "float", "f4", "=", "MathHelper", ".", "sin", "(", "-", "f2", "*", "0.01745329F", "-", "(", "float", ")", "Math", ".", "PI", ")", ";", "float", "f5", "=", "-", "MathHelper", ".", "cos", "(", "-", "f1", "*", "0.01745329F", ")", ";", "float", "f6", "=", "MathHelper", ".", "sin", "(", "-", "f1", "*", "0.01745329F", ")", ";", "float", "f7", "=", "f4", "*", "f5", ";", "float", "f8", "=", "f6", ";", "float", "f9", "=", "f3", "*", "f5", ";", "double", "d3", "=", "5D", ";", "Vec3D", "vec3d1", "=", "vec3d", ".", "addVector", "(", "(", "double", ")", "f7", "*", "d3", ",", "(", "double", ")", "f8", "*", "d3", ",", "(", "double", ")", "f9", "*", "d3", ")", ";", "MovingObjectPosition", "movingobjectposition", "=", "par1World", ".", "rayTraceBlocks_do_do", "(", "vec3d", ",", "vec3d1", ",", "par3", ",", "!", "par3", ")", ";", "return", "movingobjectposition", ";", "}", "public", "int", "getItemEnchantability", "(", ")", "{", "return", "0", ";", "}", "static", "{", "shovelSteel", "=", "(", "new", "ItemSpade", "(", "0", ",", "EnumToolMaterial", ".", "IRON", ")", ")", ".", "setIconCoord", "(", "2", ",", "5", ")", ".", "setItemName", "(", "\"shovelIron\"", ")", ";", "pickaxeSteel", "=", "(", "new", "ItemPickaxe", "(", "1", ",", "EnumToolMaterial", ".", "IRON", ")", ")", ".", "setIconCoord", "(", "2", ",", "6", ")", ".", "setItemName", "(", "\"pickaxeIron\"", ")", ";", "axeSteel", "=", "(", "new", "ItemAxe", "(", "2", ",", "EnumToolMaterial", ".", "IRON", ")", ")", ".", "setIconCoord", "(", "2", ",", "7", ")", ".", "setItemName", "(", "\"hatchetIron\"", ")", ";", "swordSteel", "=", "(", "new", "ItemSword", "(", "11", ",", "EnumToolMaterial", ".", "IRON", ")", ")", ".", "setIconCoord", "(", "2", ",", "4", ")", ".", "setItemName", "(", "\"swordIron\"", ")", ";", "swordWood", "=", "(", "new", "ItemSword", "(", "12", ",", "EnumToolMaterial", ".", "WOOD", ")", ")", ".", "setIconCoord", "(", "0", ",", "4", ")", ".", "setItemName", "(", "\"swordWood\"", ")", ";", "shovelWood", "=", "(", "new", "ItemSpade", "(", "13", ",", "EnumToolMaterial", ".", "WOOD", ")", ")", ".", "setIconCoord", "(", "0", ",", "5", ")", ".", "setItemName", "(", "\"shovelWood\"", ")", ";", "pickaxeWood", "=", "(", "new", "ItemPickaxe", "(", "14", ",", "EnumToolMaterial", ".", "WOOD", ")", ")", ".", "setIconCoord", "(", "0", ",", "6", ")", ".", "setItemName", "(", "\"pickaxeWood\"", ")", ";", "axeWood", "=", "(", "new", "ItemAxe", "(", "15", ",", "EnumToolMaterial", ".", "WOOD", ")", ")", ".", "setIconCoord", "(", "0", ",", "7", ")", ".", "setItemName", "(", "\"hatchetWood\"", ")", ";", "swordStone", "=", "(", "new", "ItemSword", "(", "16", ",", "EnumToolMaterial", ".", "STONE", ")", ")", ".", "setIconCoord", "(", "1", ",", "4", ")", ".", "setItemName", "(", "\"swordStone\"", ")", ";", "shovelStone", "=", "(", "new", "ItemSpade", "(", "17", ",", "EnumToolMaterial", ".", "STONE", ")", ")", ".", "setIconCoord", "(", "1", ",", "5", ")", ".", "setItemName", "(", "\"shovelStone\"", ")", ";", "pickaxeStone", "=", "(", "new", "ItemPickaxe", "(", "18", ",", "EnumToolMaterial", ".", "STONE", ")", ")", ".", "setIconCoord", "(", "1", ",", "6", ")", ".", "setItemName", "(", "\"pickaxeStone\"", ")", ";", "axeStone", "=", "(", "new", "ItemAxe", "(", "19", ",", "EnumToolMaterial", ".", "STONE", ")", ")", ".", "setIconCoord", "(", "1", ",", "7", ")", ".", "setItemName", "(", "\"hatchetStone\"", ")", ";", "swordDiamond", "=", "(", "new", "ItemSword", "(", "20", ",", "EnumToolMaterial", ".", "EMERALD", ")", ")", ".", "setIconCoord", "(", "3", ",", "4", ")", ".", "setItemName", "(", "\"swordDiamond\"", ")", ";", "shovelDiamond", "=", "(", "new", "ItemSpade", "(", "21", ",", "EnumToolMaterial", ".", "EMERALD", ")", ")", ".", "setIconCoord", "(", "3", ",", "5", ")", ".", "setItemName", "(", "\"\"", ")", ";", "pickaxeDiamond", "=", "(", "new", "ItemPickaxe", "(", "22", ",", "EnumToolMaterial", ".", "EMERALD", ")", ")", ".", "setIconCoord", "(", "3", ",", "6", ")", ".", "setItemName", "(", "\"\"", ")", ";", "axeDiamond", "=", "(", "new", "ItemAxe", "(", "23", ",", "EnumToolMaterial", ".", "EMERALD", ")", ")", ".", "setIconCoord", "(", "3", ",", "7", ")", ".", "setItemName", "(", "\"\"", ")", ";", "swordGold", "=", "(", "new", "ItemSword", "(", "27", ",", "EnumToolMaterial", ".", "GOLD", ")", ")", ".", "setIconCoord", "(", "4", ",", "4", ")", ".", "setItemName", "(", "\"swordGold\"", ")", ";", "shovelGold", "=", "(", "new", "ItemSpade", "(", "28", ",", "EnumToolMaterial", ".", "GOLD", ")", ")", ".", "setIconCoord", "(", "4", ",", "5", ")", ".", "setItemName", "(", "\"shovelGold\"", ")", ";", "pickaxeGold", "=", "(", "new", "ItemPickaxe", "(", "29", ",", "EnumToolMaterial", ".", "GOLD", ")", ")", ".", "setIconCoord", "(", "4", ",", "6", ")", ".", "setItemName", "(", "\"pickaxeGold\"", ")", ";", "axeGold", "=", "(", "new", "ItemAxe", "(", "30", ",", "EnumToolMaterial", ".", "GOLD", ")", ")", ".", "setIconCoord", "(", "4", ",", "7", ")", ".", "setItemName", "(", "\"hatchetGold\"", ")", ";", "gunpowder", "=", "(", "new", "Item", "(", "33", ")", ")", ".", "setIconCoord", "(", "8", ",", "2", ")", ".", "setItemName", "(", "\"sulphur\"", ")", ".", "setPotionEffect", "(", "PotionHelper", ".", "gunpowderEffect", ")", ";", "hoeWood", "=", "(", "new", "ItemHoe", "(", "34", ",", "EnumToolMaterial", ".", "WOOD", ")", ")", ".", "setIconCoord", "(", "0", ",", "8", ")", ".", "setItemName", "(", "\"hoeWood\"", ")", ";", "hoeStone", "=", "(", "new", "ItemHoe", "(", "35", ",", "EnumToolMaterial", ".", "STONE", ")", ")", ".", "setIconCoord", "(", "1", ",", "8", ")", ".", "setItemName", "(", "\"hoeStone\"", ")", ";", "hoeSteel", "=", "(", "new", "ItemHoe", "(", "36", ",", "EnumToolMaterial", ".", "IRON", ")", ")", ".", "setIconCoord", "(", "2", ",", "8", ")", ".", "setItemName", "(", "\"hoeIron\"", ")", ";", "hoeDiamond", "=", "(", "new", "ItemHoe", "(", "37", ",", "EnumToolMaterial", ".", "EMERALD", ")", ")", ".", "setIconCoord", "(", "3", ",", "8", ")", ".", "setItemName", "(", "\"hoeDiamond\"", ")", ";", "hoeGold", "=", "(", "new", "ItemHoe", "(", "38", ",", "EnumToolMaterial", ".", "GOLD", ")", ")", ".", "setIconCoord", "(", "4", ",", "8", ")", ".", "setItemName", "(", "\"hoeGold\"", ")", ";", "seeds", "=", "(", "new", "ItemSeeds", "(", "39", ",", "Block", ".", "crops", ".", "blockID", ",", "Block", ".", "tilledField", ".", "blockID", ")", ")", ".", "setIconCoord", "(", "9", ",", "0", ")", ".", "setItemName", "(", "\"seeds\"", ")", ";", "helmetLeather", "=", "(", "new", "ItemArmor", "(", "42", ",", "EnumArmorMaterial", ".", "CLOTH", ",", "0", ",", "0", ")", ")", ".", "setIconCoord", "(", "0", ",", "0", ")", ".", "setItemName", "(", "\"helmetCloth\"", ")", ";", "plateLeather", "=", "(", "new", "ItemArmor", "(", "43", ",", "EnumArmorMaterial", ".", "CLOTH", ",", "0", ",", "1", ")", ")", ".", "setIconCoord", "(", "0", ",", "1", ")", ".", "setItemName", "(", "\"\"", ")", ";", "legsLeather", "=", "(", "new", "ItemArmor", "(", "44", ",", "EnumArmorMaterial", ".", "CLOTH", ",", "0", ",", "2", ")", ")", ".", "setIconCoord", "(", "0", ",", "2", ")", ".", "setItemName", "(", "\"\"", ")", ";", "bootsLeather", "=", "(", "new", "ItemArmor", "(", "45", ",", "EnumArmorMaterial", ".", "CLOTH", ",", "0", ",", "3", ")", ")", ".", "setIconCoord", "(", "0", ",", "3", ")", ".", "setItemName", "(", "\"bootsCloth\"", ")", ";", "helmetChain", "=", "(", "new", "ItemArmor", "(", "46", ",", "EnumArmorMaterial", ".", "CHAIN", ",", "1", ",", "0", ")", ")", ".", "setIconCoord", "(", "1", ",", "0", ")", ".", "setItemName", "(", "\"helmetChain\"", ")", ";", "plateChain", "=", "(", "new", "ItemArmor", "(", "47", ",", "EnumArmorMaterial", ".", "CHAIN", ",", "1", ",", "1", ")", ")", ".", "setIconCoord", "(", "1", ",", "1", ")", ".", "setItemName", "(", "\"\"", ")", ";", "legsChain", "=", "(", "new", "ItemArmor", "(", "48", ",", "EnumArmorMaterial", ".", "CHAIN", ",", "1", ",", "2", ")", ")", ".", "setIconCoord", "(", "1", ",", "2", ")", ".", "setItemName", "(", "\"\"", ")", ";", "bootsChain", "=", "(", "new", "ItemArmor", "(", "49", ",", "EnumArmorMaterial", ".", "CHAIN", ",", "1", ",", "3", ")", ")", ".", "setIconCoord", "(", "1", ",", "3", ")", ".", "setItemName", "(", "\"bootsChain\"", ")", ";", "helmetSteel", "=", "(", "new", "ItemArmor", "(", "50", ",", "EnumArmorMaterial", ".", "IRON", ",", "2", ",", "0", ")", ")", ".", "setIconCoord", "(", "2", ",", "0", ")", ".", "setItemName", "(", "\"helmetIron\"", ")", ";", "plateSteel", "=", "(", "new", "ItemArmor", "(", "51", ",", "EnumArmorMaterial", ".", "IRON", ",", "2", ",", "1", ")", ")", ".", "setIconCoord", "(", "2", ",", "1", ")", ".", "setItemName", "(", "\"\"", ")", ";", "legsSteel", "=", "(", "new", "ItemArmor", "(", "52", ",", "EnumArmorMaterial", ".", "IRON", ",", "2", ",", "2", ")", ")", ".", "setIconCoord", "(", "2", ",", "2", ")", ".", "setItemName", "(", "\"leggingsIron\"", ")", ";", "bootsSteel", "=", "(", "new", "ItemArmor", "(", "53", ",", "EnumArmorMaterial", ".", "IRON", ",", "2", ",", "3", ")", ")", ".", "setIconCoord", "(", "2", ",", "3", ")", ".", "setItemName", "(", "\"bootsIron\"", ")", ";", "helmetDiamond", "=", "(", "new", "ItemArmor", "(", "54", ",", "EnumArmorMaterial", ".", "DIAMOND", ",", "3", ",", "0", ")", ")", ".", "setIconCoord", "(", "3", ",", "0", ")", ".", "setItemName", "(", "\"\"", ")", ";", "plateDiamond", "=", "(", "new", "ItemArmor", "(", "55", ",", "EnumArmorMaterial", ".", "DIAMOND", ",", "3", ",", "1", ")", ")", ".", "setIconCoord", "(", "3", ",", "1", ")", ".", "setItemName", "(", "\"\"", ")", ";", "legsDiamond", "=", "(", "new", "ItemArmor", "(", "56", ",", "EnumArmorMaterial", ".", "DIAMOND", ",", "3", ",", "2", ")", ")", ".", "setIconCoord", "(", "3", ",", "2", ")", ".", "setItemName", "(", "\"\"", ")", ";", "bootsDiamond", "=", "(", "new", "ItemArmor", "(", "57", ",", "EnumArmorMaterial", ".", "DIAMOND", ",", "3", ",", "3", ")", ")", ".", "setIconCoord", "(", "3", ",", "3", ")", ".", "setItemName", "(", "\"bootsDiamond\"", ")", ";", "helmetGold", "=", "(", "new", "ItemArmor", "(", "58", ",", "EnumArmorMaterial", ".", "GOLD", ",", "4", ",", "0", ")", ")", ".", "setIconCoord", "(", "4", ",", "0", ")", ".", "setItemName", "(", "\"helmetGold\"", ")", ";", "plateGold", "=", "(", "new", "ItemArmor", "(", "59", ",", "EnumArmorMaterial", ".", "GOLD", ",", "4", ",", "1", ")", ")", ".", "setIconCoord", "(", "4", ",", "1", ")", ".", "setItemName", "(", "\"\"", ")", ";", "legsGold", "=", "(", "new", "ItemArmor", "(", "60", ",", "EnumArmorMaterial", ".", "GOLD", ",", "4", ",", "2", ")", ")", ".", "setIconCoord", "(", "4", ",", "2", ")", ".", "setItemName", "(", "\"leggingsGold\"", ")", ";", "bootsGold", "=", "(", "new", "ItemArmor", "(", "61", ",", "EnumArmorMaterial", ".", "GOLD", ",", "4", ",", "3", ")", ")", ".", "setIconCoord", "(", "4", ",", "3", ")", ".", "setItemName", "(", "\"bootsGold\"", ")", ";", "appleGold", "=", "(", "new", "ItemAppleGold", "(", "66", ",", "4", ",", "1.2F", ",", "false", ")", ")", ".", "setAlwaysEdible", "(", ")", ".", "setPotionEffect", "(", "Potion", ".", "regeneration", ".", "id", ",", "5", ",", "0", ",", "1.0F", ")", ".", "setIconCoord", "(", "11", ",", "0", ")", ".", "setItemName", "(", "\"appleGold\"", ")", ";", "doorWood", "=", "(", "new", "ItemDoor", "(", "68", ",", "Material", ".", "wood", ")", ")", ".", "setIconCoord", "(", "11", ",", "2", ")", ".", "setItemName", "(", "\"doorWood\"", ")", ";", "bucketEmpty", "=", "(", "new", "ItemBucket", "(", "69", ",", "0", ")", ")", ".", "setIconCoord", "(", "10", ",", "4", ")", ".", "setItemName", "(", "\"bucket\"", ")", ";", "bucketWater", "=", "(", "new", "ItemBucket", "(", "70", ",", "Block", ".", "waterMoving", ".", "blockID", ")", ")", ".", "setIconCoord", "(", "11", ",", "4", ")", ".", "setItemName", "(", "\"bucketWater\"", ")", ".", "setContainerItem", "(", "bucketEmpty", ")", ";", "bucketLava", "=", "(", "new", "ItemBucket", "(", "71", ",", "Block", ".", "lavaMoving", ".", "blockID", ")", ")", ".", "setIconCoord", "(", "12", ",", "4", ")", ".", "setItemName", "(", "\"bucketLava\"", ")", ".", "setContainerItem", "(", "bucketEmpty", ")", ";", "doorSteel", "=", "(", "new", "ItemDoor", "(", "74", ",", "Material", ".", "iron", ")", ")", ".", "setIconCoord", "(", "12", ",", "2", ")", ".", "setItemName", "(", "\"doorIron\"", ")", ";", "redstone", "=", "(", "new", "ItemRedstone", "(", "75", ")", ")", ".", "setIconCoord", "(", "8", ",", "3", ")", ".", "setItemName", "(", "\"redstone\"", ")", ".", "setPotionEffect", "(", "PotionHelper", ".", "redstoneEffect", ")", ";", "bucketMilk", "=", "(", "new", "ItemBucketMilk", "(", "79", ")", ")", ".", "setIconCoord", "(", "13", ",", "4", ")", ".", "setItemName", "(", "\"milk\"", ")", ".", "setContainerItem", "(", "bucketEmpty", ")", ";", "reed", "=", "(", "new", "ItemReed", "(", "82", ",", "Block", ".", "reed", ")", ")", ".", "setIconCoord", "(", "11", ",", "1", ")", ".", "setItemName", "(", "\"reeds\"", ")", ";", "lightStoneDust", "=", "(", "new", "Item", "(", "92", ")", ")", ".", "setIconCoord", "(", "9", ",", "4", ")", ".", "setItemName", "(", "\"yellowDust\"", ")", ".", "setPotionEffect", "(", "PotionHelper", ".", "glowstoneEffect", ")", ";", "sugar", "=", "(", "new", "Item", "(", "97", ")", ")", ".", "setIconCoord", "(", "13", ",", "0", ")", ".", "setItemName", "(", "\"sugar\"", ")", ".", "setPotionEffect", "(", "PotionHelper", ".", "sugarEffect", ")", ";", "cake", "=", "(", "new", "ItemReed", "(", "98", ",", "Block", ".", "cake", ")", ")", ".", "setMaxStackSize", "(", "1", ")", ".", "setIconCoord", "(", "13", ",", "1", ")", ".", "setItemName", "(", "\"cake\"", ")", ";", "redstoneRepeater", "=", "(", "new", "ItemReed", "(", "100", ",", "Block", ".", "redstoneRepeaterIdle", ")", ")", ".", "setIconCoord", "(", "6", ",", "5", ")", ".", "setItemName", "(", "\"diode\"", ")", ";", "pumpkinSeeds", "=", "(", "new", "ItemSeeds", "(", "105", ",", "Block", ".", "pumpkinStem", ".", "blockID", ",", "Block", ".", "tilledField", ".", "blockID", ")", ")", ".", "setIconCoord", "(", "13", ",", "3", ")", ".", "setItemName", "(", "\"\"", ")", ";", "melonSeeds", "=", "(", "new", "ItemSeeds", "(", "106", ",", "Block", ".", "melonStem", ".", "blockID", ",", "Block", ".", "tilledField", ".", "blockID", ")", ")", ".", "setIconCoord", "(", "14", ",", "3", ")", ".", "setItemName", "(", "\"seeds_melon\"", ")", ";", "chickenRaw", "=", "(", "new", "ItemFood", "(", "109", ",", "2", ",", "0.3F", ",", "true", ")", ")", ".", "setPotionEffect", "(", "Potion", ".", "hunger", ".", "id", ",", "30", ",", "0", ",", "0.3F", ")", ".", "setIconCoord", "(", "9", ",", "7", ")", ".", "setItemName", "(", "\"chickenRaw\"", ")", ";", "rottenFlesh", "=", "(", "new", "ItemFood", "(", "111", ",", "4", ",", "0.1F", ",", "true", ")", ")", ".", "setPotionEffect", "(", "Potion", ".", "hunger", ".", "id", ",", "30", ",", "0", ",", "0.8F", ")", ".", "setIconCoord", "(", "11", ",", "5", ")", ".", "setItemName", "(", "\"rottenFlesh\"", ")", ";", "ghastTear", "=", "(", "new", "Item", "(", "114", ")", ")", ".", "setIconCoord", "(", "11", ",", "7", ")", ".", "setItemName", "(", "\"ghastTear\"", ")", ".", "setPotionEffect", "(", "PotionHelper", ".", "ghastTearEffect", ")", ";", "netherStalkSeeds", "=", "(", "new", "ItemSeeds", "(", "116", ",", "Block", ".", "netherStalk", ".", "blockID", ",", "Block", ".", "slowSand", ".", "blockID", ")", ")", ".", "setIconCoord", "(", "13", ",", "7", ")", ".", "setItemName", "(", "\"\"", ")", ".", "setPotionEffect", "(", "\"+4\"", ")", ";", "spiderEye", "=", "(", "new", "ItemFood", "(", "119", ",", "2", ",", "0.8F", ",", "false", ")", ")", ".", "setPotionEffect", "(", "Potion", ".", "poison", ".", "id", ",", "5", ",", "0", ",", "1.0F", ")", ".", "setIconCoord", "(", "11", ",", "8", ")", ".", "setItemName", "(", "\"spiderEye\"", ")", ".", "setPotionEffect", "(", "PotionHelper", ".", "spiderEyeEffect", ")", ";", "fermentedSpiderEye", "=", "(", "new", "Item", "(", "120", ")", ")", ".", "setIconCoord", "(", "10", ",", "8", ")", ".", "setItemName", "(", "\"\"", ")", ".", "setPotionEffect", "(", "PotionHelper", ".", "fermentedSpiderEyeEffect", ")", ";", "blazePowder", "=", "(", "new", "Item", "(", "121", ")", ")", ".", "setIconCoord", "(", "13", ",", "9", ")", ".", "setItemName", "(", "\"blazePowder\"", ")", ".", "setPotionEffect", "(", "PotionHelper", ".", "blazePowderEffect", ")", ";", "magmaCream", "=", "(", "new", "Item", "(", "122", ")", ")", ".", "setIconCoord", "(", "13", ",", "10", ")", ".", "setItemName", "(", "\"magmaCream\"", ")", ".", "setPotionEffect", "(", "PotionHelper", ".", "magmaCreamEffect", ")", ";", "brewingStand", "=", "(", "new", "ItemReed", "(", "123", ",", "Block", ".", "brewingStand", ")", ")", ".", "setIconCoord", "(", "12", ",", "10", ")", ".", "setItemName", "(", "\"brewingStand\"", ")", ";", "cauldron", "=", "(", "new", "ItemReed", "(", "124", ",", "Block", ".", "cauldron", ")", ")", ".", "setIconCoord", "(", "12", ",", "9", ")", ".", "setItemName", "(", "\"cauldron\"", ")", ";", "speckledMelon", "=", "(", "new", "Item", "(", "126", ")", ")", ".", "setIconCoord", "(", "9", ",", "8", ")", ".", "setItemName", "(", "\"\"", ")", ".", "setPotionEffect", "(", "PotionHelper", ".", "speckledMelonEffect", ")", ";", "StatList", ".", "initStats", "(", ")", ";", "}", "}", "</s>" ]
9,931
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "EnchantmentProtection", "extends", "Enchantment", "{", "private", "static", "final", "String", "protectionName", "[", "]", "=", "{", "\"all\"", ",", "\"fire\"", ",", "\"fall\"", ",", "\"explosion\"", ",", "\"projectile\"", "}", ";", "private", "static", "final", "int", "baseEnchantability", "[", "]", "=", "{", "1", ",", "10", ",", "5", ",", "5", ",", "3", "}", ";", "private", "static", "final", "int", "levelEnchantability", "[", "]", "=", "{", "16", ",", "8", ",", "6", ",", "8", ",", "6", "}", ";", "private", "static", "final", "int", "thresholdEnchantability", "[", "]", "=", "{", "20", ",", "12", ",", "10", ",", "12", ",", "15", "}", ";", "public", "final", "int", "protectionType", ";", "public", "EnchantmentProtection", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "super", "(", "par1", ",", "par2", ",", "EnumEnchantmentType", ".", "armor", ")", ";", "protectionType", "=", "par3", ";", "if", "(", "par3", "==", "2", ")", "{", "type", "=", "EnumEnchantmentType", ".", "armor_feet", ";", "}", "}", "public", "int", "getMinEnchantability", "(", "int", "par1", ")", "{", "return", "baseEnchantability", "[", "protectionType", "]", "+", "(", "par1", "-", "1", ")", "*", "levelEnchantability", "[", "protectionType", "]", ";", "}", "public", "int", "getMaxEnchantability", "(", "int", "par1", ")", "{", "return", "getMinEnchantability", "(", "par1", ")", "+", "thresholdEnchantability", "[", "protectionType", "]", ";", "}", "public", "int", "getMaxLevel", "(", ")", "{", "return", "4", ";", "}", "public", "int", "calcModifierDamage", "(", "int", "par1", ",", "DamageSource", "par2DamageSource", ")", "{", "if", "(", "par2DamageSource", ".", "canHarmInCreative", "(", ")", ")", "{", "return", "0", ";", "}", "int", "i", "=", "(", "6", "+", "par1", "*", "par1", ")", "/", "2", ";", "if", "(", "protectionType", "==", "0", ")", "{", "return", "i", ";", "}", "if", "(", "protectionType", "==", "1", "&&", "par2DamageSource", ".", "fireDamage", "(", ")", ")", "{", "return", "i", ";", "}", "if", "(", "protectionType", "==", "2", "&&", "par2DamageSource", "==", "DamageSource", ".", "fall", ")", "{", "return", "i", "*", "2", ";", "}", "if", "(", "protectionType", "==", "3", "&&", "par2DamageSource", "==", "DamageSource", ".", "explosion", ")", "{", "return", "i", ";", "}", "if", "(", "protectionType", "==", "4", "&&", "par2DamageSource", ".", "isProjectile", "(", ")", ")", "{", "return", "i", ";", "}", "else", "{", "return", "0", ";", "}", "}", "public", "boolean", "canApplyTogether", "(", "Enchantment", "par1Enchantment", ")", "{", "if", "(", "par1Enchantment", "instanceof", "EnchantmentProtection", ")", "{", "EnchantmentProtection", "enchantmentprotection", "=", "(", "EnchantmentProtection", ")", "par1Enchantment", ";", "if", "(", "enchantmentprotection", ".", "protectionType", "==", "protectionType", ")", "{", "return", "false", ";", "}", "return", "protectionType", "==", "2", "||", "enchantmentprotection", ".", "protectionType", "==", "2", ";", "}", "else", "{", "return", "super", ".", "canApplyTogether", "(", "par1Enchantment", ")", ";", "}", "}", "}", "</s>" ]
9,932
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "Random", ";", "public", "class", "EntityZombie", "extends", "EntityMob", "{", "public", "EntityZombie", "(", "World", "par1World", ")", "{", "super", "(", "par1World", ")", ";", "texture", "=", "\"\"", ";", "moveSpeed", "=", "0.23F", ";", "attackStrength", "=", "4", ";", "getNavigator", "(", ")", ".", "setBreakDoors", "(", "true", ")", ";", "tasks", ".", "addTask", "(", "0", ",", "new", "EntityAISwimming", "(", "this", ")", ")", ";", "tasks", ".", "addTask", "(", "1", ",", "new", "EntityAIBreakDoor", "(", "this", ")", ")", ";", "tasks", ".", "addTask", "(", "2", ",", "new", "EntityAIAttackOnCollide", "(", "this", ",", "net", ".", "minecraft", ".", "src", ".", "EntityPlayer", ".", "class", ",", "moveSpeed", ",", "false", ")", ")", ";", "tasks", ".", "addTask", "(", "3", ",", "new", "EntityAIAttackOnCollide", "(", "this", ",", "net", ".", "minecraft", ".", "src", ".", "EntityVillager", ".", "class", ",", "moveSpeed", ",", "true", ")", ")", ";", "tasks", ".", "addTask", "(", "4", ",", "new", "EntityAIMoveTwardsRestriction", "(", "this", ",", "moveSpeed", ")", ")", ";", "tasks", ".", "addTask", "(", "5", ",", "new", "EntityAIMoveThroughVillage", "(", "this", ",", "moveSpeed", ",", "false", ")", ")", ";", "tasks", ".", "addTask", "(", "6", ",", "new", "EntityAIWander", "(", "this", ",", "moveSpeed", ")", ")", ";", "tasks", ".", "addTask", "(", "7", ",", "new", "EntityAIWatchClosest", "(", "this", ",", "net", ".", "minecraft", ".", "src", ".", "EntityPlayer", ".", "class", ",", "8F", ")", ")", ";", "tasks", ".", "addTask", "(", "7", ",", "new", "EntityAILookIdle", "(", "this", ")", ")", ";", "targetTasks", ".", "addTask", "(", "1", ",", "new", "EntityAIHurtByTarget", "(", "this", ",", "false", ")", ")", ";", "targetTasks", ".", "addTask", "(", "2", ",", "new", "EntityAINearestAttackableTarget", "(", "this", ",", "net", ".", "minecraft", ".", "src", ".", "EntityPlayer", ".", "class", ",", "16F", ",", "0", ",", "true", ")", ")", ";", "targetTasks", ".", "addTask", "(", "2", ",", "new", "EntityAINearestAttackableTarget", "(", "this", ",", "net", ".", "minecraft", ".", "src", ".", "EntityVillager", ".", "class", ",", "16F", ",", "0", ",", "false", ")", ")", ";", "}", "public", "int", "getMaxHealth", "(", ")", "{", "return", "20", ";", "}", "public", "int", "getTotalArmorValue", "(", ")", "{", "return", "2", ";", "}", "protected", "boolean", "isAIEnabled", "(", ")", "{", "return", "true", ";", "}", "public", "void", "onLivingUpdate", "(", ")", "{", "if", "(", "worldObj", ".", "isDaytime", "(", ")", "&&", "!", "worldObj", ".", "isRemote", ")", "{", "float", "f", "=", "getBrightness", "(", "1.0F", ")", ";", "if", "(", "f", ">", "0.5F", "&&", "worldObj", ".", "canBlockSeeTheSky", "(", "MathHelper", ".", "floor_double", "(", "posX", ")", ",", "MathHelper", ".", "floor_double", "(", "posY", ")", ",", "MathHelper", ".", "floor_double", "(", "posZ", ")", ")", "&&", "rand", ".", "nextFloat", "(", ")", "*", "30F", "<", "(", "f", "-", "0.4F", ")", "*", "2.0F", ")", "{", "setFire", "(", "8", ")", ";", "}", "}", "super", ".", "onLivingUpdate", "(", ")", ";", "}", "protected", "String", "getLivingSound", "(", ")", "{", "return", "\"mob.zombie\"", ";", "}", "protected", "String", "getHurtSound", "(", ")", "{", "return", "\"\"", ";", "}", "protected", "String", "getDeathSound", "(", ")", "{", "return", "\"\"", ";", "}", "protected", "int", "getDropItemId", "(", ")", "{", "return", "Item", ".", "rottenFlesh", ".", "shiftedIndex", ";", "}", "public", "EnumCreatureAttribute", "getCreatureAttribute", "(", ")", "{", "return", "EnumCreatureAttribute", ".", "UNDEAD", ";", "}", "protected", "void", "dropRareDrop", "(", "int", "par1", ")", "{", "switch", "(", "rand", ".", "nextInt", "(", "4", ")", ")", "{", "case", "0", ":", "dropItem", "(", "Item", ".", "swordSteel", ".", "shiftedIndex", ",", "1", ")", ";", "break", ";", "case", "1", ":", "dropItem", "(", "Item", ".", "helmetSteel", ".", "shiftedIndex", ",", "1", ")", ";", "break", ";", "case", "2", ":", "dropItem", "(", "Item", ".", "ingotIron", ".", "shiftedIndex", ",", "1", ")", ";", "break", ";", "case", "3", ":", "dropItem", "(", "Item", ".", "shovelSteel", ".", "shiftedIndex", ",", "1", ")", ";", "break", ";", "}", "}", "}", "</s>" ]
9,933
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "enum", "EnumDoor", "{", "OPENING", ",", "WOOD_DOOR", ",", "GRATES", ",", "IRON_DOOR", ";", "}", "</s>" ]
9,934
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "*", ";", "public", "abstract", "class", "MapGenStructure", "extends", "MapGenBase", "{", "protected", "HashMap", "coordMap", ";", "public", "MapGenStructure", "(", ")", "{", "coordMap", "=", "new", "HashMap", "(", ")", ";", "}", "public", "void", "generate", "(", "IChunkProvider", "par1IChunkProvider", ",", "World", "par2World", ",", "int", "par3", ",", "int", "par4", ",", "byte", "par5ArrayOfByte", "[", "]", ")", "{", "super", ".", "generate", "(", "par1IChunkProvider", ",", "par2World", ",", "par3", ",", "par4", ",", "par5ArrayOfByte", ")", ";", "}", "protected", "void", "recursiveGenerate", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "int", "par5", ",", "byte", "par6ArrayOfByte", "[", "]", ")", "{", "if", "(", "coordMap", ".", "containsKey", "(", "Long", ".", "valueOf", "(", "ChunkCoordIntPair", ".", "chunkXZ2Int", "(", "par2", ",", "par3", ")", ")", ")", ")", "{", "return", ";", "}", "rand", ".", "nextInt", "(", ")", ";", "if", "(", "canSpawnStructureAtCoords", "(", "par2", ",", "par3", ")", ")", "{", "StructureStart", "structurestart", "=", "getStructureStart", "(", "par2", ",", "par3", ")", ";", "coordMap", ".", "put", "(", "Long", ".", "valueOf", "(", "ChunkCoordIntPair", ".", "chunkXZ2Int", "(", "par2", ",", "par3", ")", ")", ",", "structurestart", ")", ";", "}", "}", "public", "boolean", "generateStructuresInChunk", "(", "World", "par1World", ",", "Random", "par2Random", ",", "int", "par3", ",", "int", "par4", ")", "{", "int", "i", "=", "(", "par3", "<<", "4", ")", "+", "8", ";", "int", "j", "=", "(", "par4", "<<", "4", ")", "+", "8", ";", "boolean", "flag", "=", "false", ";", "Iterator", "iterator", "=", "coordMap", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "do", "{", "if", "(", "!", "iterator", ".", "hasNext", "(", ")", ")", "{", "break", ";", "}", "StructureStart", "structurestart", "=", "(", "StructureStart", ")", "iterator", ".", "next", "(", ")", ";", "if", "(", "structurestart", ".", "isSizeableStructure", "(", ")", "&&", "structurestart", ".", "getBoundingBox", "(", ")", ".", "intersectsWith", "(", "i", ",", "j", ",", "i", "+", "15", ",", "j", "+", "15", ")", ")", "{", "structurestart", ".", "generateStructure", "(", "par1World", ",", "par2Random", ",", "new", "StructureBoundingBox", "(", "i", ",", "j", ",", "i", "+", "15", ",", "j", "+", "15", ")", ")", ";", "flag", "=", "true", ";", "}", "}", "while", "(", "true", ")", ";", "return", "flag", ";", "}", "public", "boolean", "func_40204_a", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "Iterator", "iterator", "=", "coordMap", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "label0", ":", "do", "{", "if", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "StructureStart", "structurestart", "=", "(", "StructureStart", ")", "iterator", ".", "next", "(", ")", ";", "if", "(", "!", "structurestart", ".", "isSizeableStructure", "(", ")", "||", "!", "structurestart", ".", "getBoundingBox", "(", ")", ".", "intersectsWith", "(", "par1", ",", "par3", ",", "par1", ",", "par3", ")", ")", "{", "continue", ";", "}", "Iterator", "iterator1", "=", "structurestart", ".", "getComponents", "(", ")", ".", "iterator", "(", ")", ";", "StructureComponent", "structurecomponent", ";", "do", "{", "if", "(", "!", "iterator1", ".", "hasNext", "(", ")", ")", "{", "continue", "label0", ";", "}", "structurecomponent", "=", "(", "StructureComponent", ")", "iterator1", ".", "next", "(", ")", ";", "}", "while", "(", "!", "structurecomponent", ".", "getBoundingBox", "(", ")", ".", "isVecInside", "(", "par1", ",", "par2", ",", "par3", ")", ")", ";", "break", ";", "}", "else", "{", "return", "false", ";", "}", "}", "while", "(", "true", ")", ";", "return", "true", ";", "}", "public", "ChunkPosition", "getNearestInstance", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "worldObj", "=", "par1World", ";", "rand", ".", "setSeed", "(", "par1World", ".", "getSeed", "(", ")", ")", ";", "long", "l", "=", "rand", ".", "nextLong", "(", ")", ";", "long", "l1", "=", "rand", ".", "nextLong", "(", ")", ";", "long", "l2", "=", "(", "long", ")", "(", "par2", ">>", "4", ")", "*", "l", ";", "long", "l3", "=", "(", "long", ")", "(", "par4", ">>", "4", ")", "*", "l1", ";", "rand", ".", "setSeed", "(", "l2", "^", "l3", "^", "par1World", ".", "getSeed", "(", ")", ")", ";", "recursiveGenerate", "(", "par1World", ",", "par2", ">>", "4", ",", "par4", ">>", "4", ",", "0", ",", "0", ",", "null", ")", ";", "double", "d", "=", "Double", ".", "MAX_VALUE", ";", "ChunkPosition", "chunkposition", "=", "null", ";", "Object", "obj", "=", "coordMap", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "do", "{", "if", "(", "!", "(", "(", "Iterator", ")", "(", "obj", ")", ")", ".", "hasNext", "(", ")", ")", "{", "break", ";", "}", "StructureStart", "structurestart", "=", "(", "StructureStart", ")", "(", "(", "Iterator", ")", "(", "obj", ")", ")", ".", "next", "(", ")", ";", "if", "(", "structurestart", ".", "isSizeableStructure", "(", ")", ")", "{", "StructureComponent", "structurecomponent", "=", "(", "StructureComponent", ")", "structurestart", ".", "getComponents", "(", ")", ".", "get", "(", "0", ")", ";", "ChunkPosition", "chunkposition2", "=", "structurecomponent", ".", "getCenter", "(", ")", ";", "int", "i", "=", "chunkposition2", ".", "x", "-", "par2", ";", "int", "k", "=", "chunkposition2", ".", "y", "-", "par3", ";", "int", "j1", "=", "chunkposition2", ".", "z", "-", "par4", ";", "double", "d1", "=", "i", "+", "i", "*", "k", "*", "k", "+", "j1", "*", "j1", ";", "if", "(", "d1", "<", "d", ")", "{", "d", "=", "d1", ";", "chunkposition", "=", "chunkposition2", ";", "}", "}", "}", "while", "(", "true", ")", ";", "if", "(", "chunkposition", "!=", "null", ")", "{", "return", "chunkposition", ";", "}", "obj", "=", "func_40203_a", "(", ")", ";", "if", "(", "obj", "!=", "null", ")", "{", "ChunkPosition", "chunkposition1", "=", "null", ";", "Iterator", "iterator", "=", "(", "(", "List", ")", "(", "obj", ")", ")", ".", "iterator", "(", ")", ";", "do", "{", "if", "(", "!", "iterator", ".", "hasNext", "(", ")", ")", "{", "break", ";", "}", "ChunkPosition", "chunkposition3", "=", "(", "ChunkPosition", ")", "iterator", ".", "next", "(", ")", ";", "int", "j", "=", "chunkposition3", ".", "x", "-", "par2", ";", "int", "i1", "=", "chunkposition3", ".", "y", "-", "par3", ";", "int", "k1", "=", "chunkposition3", ".", "z", "-", "par4", ";", "double", "d2", "=", "j", "+", "j", "*", "i1", "*", "i1", "+", "k1", "*", "k1", ";", "if", "(", "d2", "<", "d", ")", "{", "d", "=", "d2", ";", "chunkposition1", "=", "chunkposition3", ";", "}", "}", "while", "(", "true", ")", ";", "return", "chunkposition1", ";", "}", "else", "{", "return", "null", ";", "}", "}", "protected", "List", "func_40203_a", "(", ")", "{", "return", "null", ";", "}", "protected", "abstract", "boolean", "canSpawnStructureAtCoords", "(", "int", "i", ",", "int", "j", ")", ";", "protected", "abstract", "StructureStart", "getStructureStart", "(", "int", "i", ",", "int", "j", ")", ";", "}", "</s>" ]
9,935
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "net", ".", "minecraft", ".", "server", ".", "MinecraftServer", ";", "public", "class", "WorldServer", "extends", "World", "{", "public", "ChunkProviderServer", "chunkProviderServer", ";", "public", "boolean", "disableSpawnProtection", ";", "public", "boolean", "levelSaving", ";", "private", "MinecraftServer", "mcServer", ";", "private", "IntHashMap", "entityInstanceIdMap", ";", "public", "WorldServer", "(", "MinecraftServer", "par1MinecraftServer", ",", "ISaveHandler", "par2ISaveHandler", ",", "String", "par3Str", ",", "int", "par4", ",", "WorldSettings", "par5WorldSettings", ")", "{", "super", "(", "par2ISaveHandler", ",", "par3Str", ",", "par5WorldSettings", ",", "WorldProvider", ".", "getProviderForDimension", "(", "par4", ")", ")", ";", "disableSpawnProtection", "=", "false", ";", "mcServer", "=", "par1MinecraftServer", ";", "if", "(", "entityInstanceIdMap", "==", "null", ")", "{", "entityInstanceIdMap", "=", "new", "IntHashMap", "(", ")", ";", "}", "}", "public", "void", "updateEntityWithOptionalForce", "(", "Entity", "par1Entity", ",", "boolean", "par2", ")", "{", "if", "(", "!", "mcServer", ".", "spawnPeacefulMobs", "&&", "(", "(", "par1Entity", "instanceof", "EntityAnimal", ")", "||", "(", "par1Entity", "instanceof", "EntityWaterMob", ")", ")", ")", "{", "par1Entity", ".", "setDead", "(", ")", ";", "}", "if", "(", "!", "mcServer", ".", "field_44002_p", "&&", "(", "par1Entity", "instanceof", "INpc", ")", ")", "{", "par1Entity", ".", "setDead", "(", ")", ";", "}", "if", "(", "par1Entity", ".", "riddenByEntity", "==", "null", "||", "!", "(", "par1Entity", ".", "riddenByEntity", "instanceof", "EntityPlayer", ")", ")", "{", "super", ".", "updateEntityWithOptionalForce", "(", "par1Entity", ",", "par2", ")", ";", "}", "}", "public", "void", "func_12017_b", "(", "Entity", "par1Entity", ",", "boolean", "par2", ")", "{", "super", ".", "updateEntityWithOptionalForce", "(", "par1Entity", ",", "par2", ")", ";", "}", "protected", "IChunkProvider", "createChunkProvider", "(", ")", "{", "IChunkLoader", "ichunkloader", "=", "saveHandler", ".", "getChunkLoader", "(", "worldProvider", ")", ";", "chunkProviderServer", "=", "new", "ChunkProviderServer", "(", "this", ",", "ichunkloader", ",", "worldProvider", ".", "getChunkProvider", "(", ")", ")", ";", "return", "chunkProviderServer", ";", "}", "public", "List", "getTileEntityList", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "int", "par5", ",", "int", "par6", ")", "{", "ArrayList", "arraylist", "=", "new", "ArrayList", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "loadedTileEntityList", ".", "size", "(", ")", ";", "i", "++", ")", "{", "TileEntity", "tileentity", "=", "(", "TileEntity", ")", "loadedTileEntityList", ".", "get", "(", "i", ")", ";", "if", "(", "tileentity", ".", "xCoord", ">=", "par1", "&&", "tileentity", ".", "yCoord", ">=", "par2", "&&", "tileentity", ".", "zCoord", ">=", "par3", "&&", "tileentity", ".", "xCoord", "<", "par4", "&&", "tileentity", ".", "yCoord", "<", "par5", "&&", "tileentity", ".", "zCoord", "<", "par6", ")", "{", "arraylist", ".", "add", "(", "tileentity", ")", ";", "}", "}", "return", "arraylist", ";", "}", "public", "boolean", "canMineBlock", "(", "EntityPlayer", "par1EntityPlayer", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "int", "i", "=", "MathHelper", ".", "abs", "(", "par2", "-", "worldInfo", ".", "getSpawnX", "(", ")", ")", ";", "int", "j", "=", "MathHelper", ".", "abs", "(", "par4", "-", "worldInfo", ".", "getSpawnZ", "(", ")", ")", ";", "if", "(", "i", ">", "j", ")", "{", "j", "=", "i", ";", "}", "return", "j", ">", "16", "||", "mcServer", ".", "configManager", ".", "isOp", "(", "par1EntityPlayer", ".", "username", ")", ";", "}", "protected", "void", "generateSpawnPoint", "(", ")", "{", "if", "(", "entityInstanceIdMap", "==", "null", ")", "{", "entityInstanceIdMap", "=", "new", "IntHashMap", "(", ")", ";", "}", "super", ".", "generateSpawnPoint", "(", ")", ";", "}", "protected", "void", "obtainEntitySkin", "(", "Entity", "par1Entity", ")", "{", "super", ".", "obtainEntitySkin", "(", "par1Entity", ")", ";", "entityInstanceIdMap", ".", "addKey", "(", "par1Entity", ".", "entityId", ",", "par1Entity", ")", ";", "Entity", "aentity", "[", "]", "=", "par1Entity", ".", "getParts", "(", ")", ";", "if", "(", "aentity", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "aentity", ".", "length", ";", "i", "++", ")", "{", "entityInstanceIdMap", ".", "addKey", "(", "aentity", "[", "i", "]", ".", "entityId", ",", "aentity", "[", "i", "]", ")", ";", "}", "}", "}", "protected", "void", "releaseEntitySkin", "(", "Entity", "par1Entity", ")", "{", "super", ".", "releaseEntitySkin", "(", "par1Entity", ")", ";", "entityInstanceIdMap", ".", "removeObject", "(", "par1Entity", ".", "entityId", ")", ";", "Entity", "aentity", "[", "]", "=", "par1Entity", ".", "getParts", "(", ")", ";", "if", "(", "aentity", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "aentity", ".", "length", ";", "i", "++", ")", "{", "entityInstanceIdMap", ".", "removeObject", "(", "aentity", "[", "i", "]", ".", "entityId", ")", ";", "}", "}", "}", "public", "Entity", "func_6158_a", "(", "int", "par1", ")", "{", "return", "(", "Entity", ")", "entityInstanceIdMap", ".", "lookup", "(", "par1", ")", ";", "}", "public", "boolean", "addWeatherEffect", "(", "Entity", "par1Entity", ")", "{", "if", "(", "super", ".", "addWeatherEffect", "(", "par1Entity", ")", ")", "{", "mcServer", ".", "configManager", ".", "sendPacketToPlayersAroundPoint", "(", "par1Entity", ".", "posX", ",", "par1Entity", ".", "posY", ",", "par1Entity", ".", "posZ", ",", "512D", ",", "worldProvider", ".", "worldType", ",", "new", "Packet71Weather", "(", "par1Entity", ")", ")", ";", "return", "true", ";", "}", "else", "{", "return", "false", ";", "}", "}", "public", "void", "setEntityState", "(", "Entity", "par1Entity", ",", "byte", "par2", ")", "{", "Packet38EntityStatus", "packet38entitystatus", "=", "new", "Packet38EntityStatus", "(", "par1Entity", ".", "entityId", ",", "par2", ")", ";", "mcServer", ".", "getEntityTracker", "(", "worldProvider", ".", "worldType", ")", ".", "sendPacketToTrackedPlayersAndTrackedEntity", "(", "par1Entity", ",", "packet38entitystatus", ")", ";", "}", "public", "Explosion", "newExplosion", "(", "Entity", "par1Entity", ",", "double", "par2", ",", "double", "par4", ",", "double", "par6", ",", "float", "par8", ",", "boolean", "par9", ")", "{", "Explosion", "explosion", "=", "new", "Explosion", "(", "this", ",", "par1Entity", ",", "par2", ",", "par4", ",", "par6", ",", "par8", ")", ";", "explosion", ".", "isFlaming", "=", "par9", ";", "explosion", ".", "doExplosionA", "(", ")", ";", "explosion", ".", "doExplosionB", "(", "false", ")", ";", "mcServer", ".", "configManager", ".", "sendPacketToPlayersAroundPoint", "(", "par2", ",", "par4", ",", "par6", ",", "64D", ",", "worldProvider", ".", "worldType", ",", "new", "Packet60Explosion", "(", "par2", ",", "par4", ",", "par6", ",", "par8", ",", "explosion", ".", "destroyedBlockPositions", ")", ")", ";", "return", "explosion", ";", "}", "public", "void", "playNoteAt", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "int", "par5", ")", "{", "super", ".", "playNoteAt", "(", "par1", ",", "par2", ",", "par3", ",", "par4", ",", "par5", ")", ";", "mcServer", ".", "configManager", ".", "sendPacketToPlayersAroundPoint", "(", "par1", ",", "par2", ",", "par3", ",", "64D", ",", "worldProvider", ".", "worldType", ",", "new", "Packet54PlayNoteBlock", "(", "par1", ",", "par2", ",", "par3", ",", "par4", ",", "par5", ")", ")", ";", "}", "public", "void", "func_30006_w", "(", ")", "{", "saveHandler", ".", "func_22093_e", "(", ")", ";", "}", "protected", "void", "updateWeather", "(", ")", "{", "boolean", "flag", "=", "isRaining", "(", ")", ";", "super", ".", "updateWeather", "(", ")", ";", "if", "(", "flag", "!=", "isRaining", "(", ")", ")", "{", "if", "(", "flag", ")", "{", "mcServer", ".", "configManager", ".", "sendPacketToAllPlayers", "(", "new", "Packet70Bed", "(", "2", ",", "0", ")", ")", ";", "}", "else", "{", "mcServer", ".", "configManager", ".", "sendPacketToAllPlayers", "(", "new", "Packet70Bed", "(", "1", ",", "0", ")", ")", ";", "}", "}", "}", "}", "</s>" ]
9,936
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "ItemMap", "extends", "ItemMapBase", "{", "protected", "ItemMap", "(", "int", "par1", ")", "{", "super", "(", "par1", ")", ";", "setMaxStackSize", "(", "1", ")", ";", "}", "public", "MapData", "getMapData", "(", "ItemStack", "par1ItemStack", ",", "World", "par2World", ")", "{", "String", "s", "=", "(", "new", "StringBuilder", "(", ")", ")", ".", "append", "(", "\"map_\"", ")", ".", "append", "(", "par1ItemStack", ".", "getItemDamage", "(", ")", ")", ".", "toString", "(", ")", ";", "MapData", "mapdata", "=", "(", "MapData", ")", "par2World", ".", "loadItemData", "(", "net", ".", "minecraft", ".", "src", ".", "MapData", ".", "class", ",", "(", "new", "StringBuilder", "(", ")", ")", ".", "append", "(", "\"map_\"", ")", ".", "append", "(", "par1ItemStack", ".", "getItemDamage", "(", ")", ")", ".", "toString", "(", ")", ")", ";", "if", "(", "mapdata", "==", "null", ")", "{", "par1ItemStack", ".", "setItemDamage", "(", "par2World", ".", "getUniqueDataId", "(", "\"map\"", ")", ")", ";", "String", "s1", "=", "(", "new", "StringBuilder", "(", ")", ")", ".", "append", "(", "\"map_\"", ")", ".", "append", "(", "par1ItemStack", ".", "getItemDamage", "(", ")", ")", ".", "toString", "(", ")", ";", "mapdata", "=", "new", "MapData", "(", "s1", ")", ";", "mapdata", ".", "xCenter", "=", "par2World", ".", "getWorldInfo", "(", ")", ".", "getSpawnX", "(", ")", ";", "mapdata", ".", "zCenter", "=", "par2World", ".", "getWorldInfo", "(", ")", ".", "getSpawnZ", "(", ")", ";", "mapdata", ".", "scale", "=", "3", ";", "mapdata", ".", "dimension", "=", "(", "byte", ")", "par2World", ".", "worldProvider", ".", "worldType", ";", "mapdata", ".", "markDirty", "(", ")", ";", "par2World", ".", "setItemData", "(", "s1", ",", "mapdata", ")", ";", "}", "return", "mapdata", ";", "}", "public", "void", "updateMapData", "(", "World", "par1World", ",", "Entity", "par2Entity", ",", "MapData", "par3MapData", ")", "{", "if", "(", "par1World", ".", "worldProvider", ".", "worldType", "!=", "par3MapData", ".", "dimension", ")", "{", "return", ";", "}", "char", "c", "=", "'\\200'", ";", "char", "c1", "=", "'\\200'", ";", "int", "i", "=", "1", "<<", "par3MapData", ".", "scale", ";", "int", "j", "=", "par3MapData", ".", "xCenter", ";", "int", "k", "=", "par3MapData", ".", "zCenter", ";", "int", "l", "=", "MathHelper", ".", "floor_double", "(", "par2Entity", ".", "posX", "-", "(", "double", ")", "j", ")", "/", "i", "+", "c", "/", "2", ";", "int", "i1", "=", "MathHelper", ".", "floor_double", "(", "par2Entity", ".", "posZ", "-", "(", "double", ")", "k", ")", "/", "i", "+", "c1", "/", "2", ";", "int", "j1", "=", "128", "/", "i", ";", "if", "(", "par1World", ".", "worldProvider", ".", "hasNoSky", ")", "{", "j1", "/=", "2", ";", "}", "par3MapData", ".", "field_28159_g", "++", ";", "for", "(", "int", "k1", "=", "(", "l", "-", "j1", ")", "+", "1", ";", "k1", "<", "l", "+", "j1", ";", "k1", "++", ")", "{", "if", "(", "(", "k1", "&", "0xf", ")", "!=", "(", "par3MapData", ".", "field_28159_g", "&", "0xf", ")", ")", "{", "continue", ";", "}", "int", "l1", "=", "255", ";", "int", "i2", "=", "0", ";", "double", "d", "=", "0.0D", ";", "for", "(", "int", "j2", "=", "i1", "-", "j1", "-", "1", ";", "j2", "<", "i1", "+", "j1", ";", "j2", "++", ")", "{", "if", "(", "k1", "<", "0", "||", "j2", "<", "-", "1", "||", "k1", ">=", "c", "||", "j2", ">=", "c1", ")", "{", "continue", ";", "}", "int", "k2", "=", "k1", "-", "l", ";", "int", "l2", "=", "j2", "-", "i1", ";", "boolean", "flag", "=", "k2", "*", "k2", "+", "l2", "*", "l2", ">", "(", "j1", "-", "2", ")", "*", "(", "j1", "-", "2", ")", ";", "int", "i3", "=", "(", "(", "j", "/", "i", "+", "k1", ")", "-", "c", "/", "2", ")", "*", "i", ";", "int", "j3", "=", "(", "(", "k", "/", "i", "+", "j2", ")", "-", "c1", "/", "2", ")", "*", "i", ";", "int", "k3", "=", "0", ";", "int", "l3", "=", "0", ";", "int", "i4", "=", "0", ";", "int", "ai", "[", "]", "=", "new", "int", "[", "256", "]", ";", "Chunk", "chunk", "=", "par1World", ".", "getChunkFromBlockCoords", "(", "i3", ",", "j3", ")", ";", "int", "j4", "=", "i3", "&", "0xf", ";", "int", "k4", "=", "j3", "&", "0xf", ";", "int", "l4", "=", "0", ";", "double", "d1", "=", "0.0D", ";", "if", "(", "par1World", ".", "worldProvider", ".", "hasNoSky", ")", "{", "int", "i5", "=", "i3", "+", "j3", "*", "0x389bf", ";", "i5", "=", "i5", "*", "i5", "*", "0x1dd6751", "+", "i5", "*", "11", ";", "if", "(", "(", "i5", ">>", "20", "&", "1", ")", "==", "0", ")", "{", "ai", "[", "Block", ".", "dirt", ".", "blockID", "]", "+=", "10", ";", "}", "else", "{", "ai", "[", "Block", ".", "stone", ".", "blockID", "]", "+=", "10", ";", "}", "d1", "=", "100D", ";", "}", "else", "{", "for", "(", "int", "j5", "=", "0", ";", "j5", "<", "i", ";", "j5", "++", ")", "{", "for", "(", "int", "l5", "=", "0", ";", "l5", "<", "i", ";", "l5", "++", ")", "{", "int", "j6", "=", "chunk", ".", "getHeightValue", "(", "j5", "+", "j4", ",", "l5", "+", "k4", ")", "+", "1", ";", "int", "l6", "=", "0", ";", "if", "(", "j6", ">", "1", ")", "{", "boolean", "flag1", "=", "false", ";", "do", "{", "flag1", "=", "true", ";", "l6", "=", "chunk", ".", "getBlockID", "(", "j5", "+", "j4", ",", "j6", "-", "1", ",", "l5", "+", "k4", ")", ";", "if", "(", "l6", "==", "0", ")", "{", "flag1", "=", "false", ";", "}", "else", "if", "(", "j6", ">", "0", "&&", "l6", ">", "0", "&&", "Block", ".", "blocksList", "[", "l6", "]", ".", "blockMaterial", ".", "materialMapColor", "==", "MapColor", ".", "airColor", ")", "{", "flag1", "=", "false", ";", "}", "if", "(", "!", "flag1", ")", "{", "j6", "--", ";", "l6", "=", "chunk", ".", "getBlockID", "(", "j5", "+", "j4", ",", "j6", "-", "1", ",", "l5", "+", "k4", ")", ";", "}", "}", "while", "(", "j6", ">", "0", "&&", "!", "flag1", ")", ";", "if", "(", "j6", ">", "0", "&&", "l6", "!=", "0", "&&", "Block", ".", "blocksList", "[", "l6", "]", ".", "blockMaterial", ".", "isLiquid", "(", ")", ")", "{", "int", "i7", "=", "j6", "-", "1", ";", "int", "k7", "=", "0", ";", "do", "{", "k7", "=", "chunk", ".", "getBlockID", "(", "j5", "+", "j4", ",", "i7", "--", ",", "l5", "+", "k4", ")", ";", "l4", "++", ";", "}", "while", "(", "i7", ">", "0", "&&", "k7", "!=", "0", "&&", "Block", ".", "blocksList", "[", "k7", "]", ".", "blockMaterial", ".", "isLiquid", "(", ")", ")", ";", "}", "}", "d1", "+=", "(", "double", ")", "j6", "/", "(", "double", ")", "(", "i", "*", "i", ")", ";", "ai", "[", "l6", "]", "++", ";", "}", "}", "}", "l4", "/=", "i", "*", "i", ";", "k3", "/=", "i", "*", "i", ";", "l3", "/=", "i", "*", "i", ";", "i4", "/=", "i", "*", "i", ";", "int", "k5", "=", "0", ";", "int", "i6", "=", "0", ";", "for", "(", "int", "k6", "=", "0", ";", "k6", "<", "256", ";", "k6", "++", ")", "{", "if", "(", "ai", "[", "k6", "]", ">", "k5", ")", "{", "i6", "=", "k6", ";", "k5", "=", "ai", "[", "k6", "]", ";", "}", "}", "double", "d2", "=", "(", "(", "d1", "-", "d", ")", "*", "4D", ")", "/", "(", "double", ")", "(", "i", "+", "4", ")", "+", "(", "(", "double", ")", "(", "k1", "+", "j2", "&", "1", ")", "-", "0.5D", ")", "*", "0.40000000000000002D", ";", "byte", "byte0", "=", "1", ";", "if", "(", "d2", ">", "0.59999999999999998D", ")", "{", "byte0", "=", "2", ";", "}", "if", "(", "d2", "<", "-", "0.59999999999999998D", ")", "{", "byte0", "=", "0", ";", "}", "int", "j7", "=", "0", ";", "if", "(", "i6", ">", "0", ")", "{", "MapColor", "mapcolor", "=", "Block", ".", "blocksList", "[", "i6", "]", ".", "blockMaterial", ".", "materialMapColor", ";", "if", "(", "mapcolor", "==", "MapColor", ".", "waterColor", ")", "{", "double", "d3", "=", "(", "double", ")", "l4", "*", "0.10000000000000001D", "+", "(", "double", ")", "(", "k1", "+", "j2", "&", "1", ")", "*", "0.20000000000000001D", ";", "byte0", "=", "1", ";", "if", "(", "d3", "<", "0.5D", ")", "{", "byte0", "=", "2", ";", "}", "if", "(", "d3", ">", "0.90000000000000002D", ")", "{", "byte0", "=", "0", ";", "}", "}", "j7", "=", "mapcolor", ".", "colorIndex", ";", "}", "d", "=", "d1", ";", "if", "(", "j2", "<", "0", "||", "k2", "*", "k2", "+", "l2", "*", "l2", ">=", "j1", "*", "j1", "||", "flag", "&&", "(", "k1", "+", "j2", "&", "1", ")", "==", "0", ")", "{", "continue", ";", "}", "byte", "byte1", "=", "par3MapData", ".", "colors", "[", "k1", "+", "j2", "*", "c", "]", ";", "byte", "byte2", "=", "(", "byte", ")", "(", "j7", "*", "4", "+", "byte0", ")", ";", "if", "(", "byte1", "==", "byte2", ")", "{", "continue", ";", "}", "if", "(", "l1", ">", "j2", ")", "{", "l1", "=", "j2", ";", "}", "if", "(", "i2", "<", "j2", ")", "{", "i2", "=", "j2", ";", "}", "par3MapData", ".", "colors", "[", "k1", "+", "j2", "*", "c", "]", "=", "byte2", ";", "}", "if", "(", "l1", "<=", "i2", ")", "{", "par3MapData", ".", "func_28153_a", "(", "k1", ",", "l1", ",", "i2", ")", ";", "}", "}", "}", "public", "void", "onUpdate", "(", "ItemStack", "par1ItemStack", ",", "World", "par2World", ",", "Entity", "par3Entity", ",", "int", "par4", ",", "boolean", "par5", ")", "{", "if", "(", "par2World", ".", "isRemote", ")", "{", "return", ";", "}", "MapData", "mapdata", "=", "getMapData", "(", "par1ItemStack", ",", "par2World", ")", ";", "if", "(", "par3Entity", "instanceof", "EntityPlayer", ")", "{", "EntityPlayer", "entityplayer", "=", "(", "EntityPlayer", ")", "par3Entity", ";", "mapdata", ".", "func_28155_a", "(", "entityplayer", ",", "par1ItemStack", ")", ";", "}", "if", "(", "par5", ")", "{", "updateMapData", "(", "par2World", ",", "par3Entity", ",", "mapdata", ")", ";", "}", "}", "public", "void", "onCreated", "(", "ItemStack", "par1ItemStack", ",", "World", "par2World", ",", "EntityPlayer", "par3EntityPlayer", ")", "{", "par1ItemStack", ".", "setItemDamage", "(", "par2World", ".", "getUniqueDataId", "(", "\"map\"", ")", ")", ";", "String", "s", "=", "(", "new", "StringBuilder", "(", ")", ")", ".", "append", "(", "\"map_\"", ")", ".", "append", "(", "par1ItemStack", ".", "getItemDamage", "(", ")", ")", ".", "toString", "(", ")", ";", "MapData", "mapdata", "=", "new", "MapData", "(", "s", ")", ";", "par2World", ".", "setItemData", "(", "s", ",", "mapdata", ")", ";", "mapdata", ".", "xCenter", "=", "MathHelper", ".", "floor_double", "(", "par3EntityPlayer", ".", "posX", ")", ";", "mapdata", ".", "zCenter", "=", "MathHelper", ".", "floor_double", "(", "par3EntityPlayer", ".", "posZ", ")", ";", "mapdata", ".", "scale", "=", "3", ";", "mapdata", ".", "dimension", "=", "(", "byte", ")", "par2World", ".", "worldProvider", ".", "worldType", ";", "mapdata", ".", "markDirty", "(", ")", ";", "}", "public", "Packet", "getUpdatePacket", "(", "ItemStack", "par1ItemStack", ",", "World", "par2World", ",", "EntityPlayer", "par3EntityPlayer", ")", "{", "byte", "abyte0", "[", "]", "=", "getMapData", "(", "par1ItemStack", ",", "par2World", ")", ".", "func_28154_a", "(", "par1ItemStack", ",", "par2World", ",", "par3EntityPlayer", ")", ";", "if", "(", "abyte0", "==", "null", ")", "{", "return", "null", ";", "}", "else", "{", "return", "new", "Packet131MapData", "(", "(", "short", ")", "Item", ".", "map", ".", "shiftedIndex", ",", "(", "short", ")", "par1ItemStack", ".", "getItemDamage", "(", ")", ",", "abyte0", ")", ";", "}", "}", "}", "</s>" ]
9,937
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "GenLayerRiver", "extends", "GenLayer", "{", "public", "GenLayerRiver", "(", "long", "par1", ",", "GenLayer", "par3GenLayer", ")", "{", "super", "(", "par1", ")", ";", "super", ".", "parent", "=", "par3GenLayer", ";", "}", "public", "int", "[", "]", "getInts", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "int", "i", "=", "par1", "-", "1", ";", "int", "j", "=", "par2", "-", "1", ";", "int", "k", "=", "par3", "+", "2", ";", "int", "l", "=", "par4", "+", "2", ";", "int", "ai", "[", "]", "=", "parent", ".", "getInts", "(", "i", ",", "j", ",", "k", ",", "l", ")", ";", "int", "ai1", "[", "]", "=", "IntCache", ".", "getIntCache", "(", "par3", "*", "par4", ")", ";", "for", "(", "int", "i1", "=", "0", ";", "i1", "<", "par4", ";", "i1", "++", ")", "{", "for", "(", "int", "j1", "=", "0", ";", "j1", "<", "par3", ";", "j1", "++", ")", "{", "int", "k1", "=", "ai", "[", "j1", "+", "0", "+", "(", "i1", "+", "1", ")", "*", "k", "]", ";", "int", "l1", "=", "ai", "[", "j1", "+", "2", "+", "(", "i1", "+", "1", ")", "*", "k", "]", ";", "int", "i2", "=", "ai", "[", "j1", "+", "1", "+", "(", "i1", "+", "0", ")", "*", "k", "]", ";", "int", "j2", "=", "ai", "[", "j1", "+", "1", "+", "(", "i1", "+", "2", ")", "*", "k", "]", ";", "int", "k2", "=", "ai", "[", "j1", "+", "1", "+", "(", "i1", "+", "1", ")", "*", "k", "]", ";", "if", "(", "k2", "==", "0", "||", "k1", "==", "0", "||", "l1", "==", "0", "||", "i2", "==", "0", "||", "j2", "==", "0", ")", "{", "ai1", "[", "j1", "+", "i1", "*", "par3", "]", "=", "BiomeGenBase", ".", "river", ".", "biomeID", ";", "continue", ";", "}", "if", "(", "k2", "!=", "k1", "||", "k2", "!=", "i2", "||", "k2", "!=", "l1", "||", "k2", "!=", "j2", ")", "{", "ai1", "[", "j1", "+", "i1", "*", "par3", "]", "=", "BiomeGenBase", ".", "river", ".", "biomeID", ";", "}", "else", "{", "ai1", "[", "j1", "+", "i1", "*", "par3", "]", "=", "-", "1", ";", "}", "}", "}", "return", "ai1", ";", "}", "}", "</s>" ]
9,938
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "io", ".", "*", ";", "public", "class", "Packet130UpdateSign", "extends", "Packet", "{", "public", "int", "xPosition", ";", "public", "int", "yPosition", ";", "public", "int", "zPosition", ";", "public", "String", "signLines", "[", "]", ";", "public", "Packet130UpdateSign", "(", ")", "{", "isChunkDataPacket", "=", "true", ";", "}", "public", "Packet130UpdateSign", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "String", "par4ArrayOfStr", "[", "]", ")", "{", "isChunkDataPacket", "=", "true", ";", "xPosition", "=", "par1", ";", "yPosition", "=", "par2", ";", "zPosition", "=", "par3", ";", "signLines", "=", "par4ArrayOfStr", ";", "}", "public", "void", "readPacketData", "(", "DataInputStream", "par1DataInputStream", ")", "throws", "IOException", "{", "xPosition", "=", "par1DataInputStream", ".", "readInt", "(", ")", ";", "yPosition", "=", "par1DataInputStream", ".", "readShort", "(", ")", ";", "zPosition", "=", "par1DataInputStream", ".", "readInt", "(", ")", ";", "signLines", "=", "new", "String", "[", "4", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "4", ";", "i", "++", ")", "{", "signLines", "[", "i", "]", "=", "readString", "(", "par1DataInputStream", ",", "15", ")", ";", "}", "}", "public", "void", "writePacketData", "(", "DataOutputStream", "par1DataOutputStream", ")", "throws", "IOException", "{", "par1DataOutputStream", ".", "writeInt", "(", "xPosition", ")", ";", "par1DataOutputStream", ".", "writeShort", "(", "yPosition", ")", ";", "par1DataOutputStream", ".", "writeInt", "(", "zPosition", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "4", ";", "i", "++", ")", "{", "writeString", "(", "signLines", "[", "i", "]", ",", "par1DataOutputStream", ")", ";", "}", "}", "public", "void", "processPacket", "(", "NetHandler", "par1NetHandler", ")", "{", "par1NetHandler", ".", "handleUpdateSign", "(", "this", ")", ";", "}", "public", "int", "getPacketSize", "(", ")", "{", "int", "i", "=", "0", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "4", ";", "j", "++", ")", "{", "i", "+=", "signLines", "[", "j", "]", ".", "length", "(", ")", ";", "}", "return", "i", ";", "}", "}", "</s>" ]
9,939
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "BlockOreStorage", "extends", "Block", "{", "public", "BlockOreStorage", "(", "int", "par1", ",", "int", "par2", ")", "{", "super", "(", "par1", ",", "Material", ".", "iron", ")", ";", "blockIndexInTexture", "=", "par2", ";", "}", "public", "int", "getBlockTextureFromSide", "(", "int", "par1", ")", "{", "return", "blockIndexInTexture", ";", "}", "}", "</s>" ]
9,940
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "awt", ".", "event", ".", "ActionEvent", ";", "import", "java", ".", "awt", ".", "event", ".", "ActionListener", ";", "import", "javax", ".", "swing", ".", "JTextField", ";", "import", "net", ".", "minecraft", ".", "server", ".", "MinecraftServer", ";", "class", "ServerGuiCommandListener", "implements", "ActionListener", "{", "final", "JTextField", "textField", ";", "final", "ServerGUI", "mcServerGui", ";", "ServerGuiCommandListener", "(", "ServerGUI", "par1ServerGUI", ",", "JTextField", "par2JTextField", ")", "{", "mcServerGui", "=", "par1ServerGUI", ";", "textField", "=", "par2JTextField", ";", "}", "public", "void", "actionPerformed", "(", "ActionEvent", "par1ActionEvent", ")", "{", "String", "s", "=", "textField", ".", "getText", "(", ")", ".", "trim", "(", ")", ";", "if", "(", "s", ".", "length", "(", ")", ">", "0", ")", "{", "ServerGUI", ".", "getMinecraftServer", "(", "mcServerGui", ")", ".", "addCommand", "(", "s", ",", "mcServerGui", ")", ";", "}", "textField", ".", "setText", "(", "\"\"", ")", ";", "}", "}", "</s>" ]
9,941
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "abstract", "class", "NetHandler", "{", "public", "NetHandler", "(", ")", "{", "}", "public", "abstract", "boolean", "isServerHandler", "(", ")", ";", "public", "void", "func_48070_a", "(", "Packet51MapChunk", "packet51mapchunk", ")", "{", "}", "public", "void", "registerPacket", "(", "Packet", "packet", ")", "{", "}", "public", "void", "handleErrorMessage", "(", "String", "s", ",", "Object", "aobj", "[", "]", ")", "{", "}", "public", "void", "handleKickDisconnect", "(", "Packet255KickDisconnect", "par1Packet255KickDisconnect", ")", "{", "registerPacket", "(", "par1Packet255KickDisconnect", ")", ";", "}", "public", "void", "handleLogin", "(", "Packet1Login", "par1Packet1Login", ")", "{", "registerPacket", "(", "par1Packet1Login", ")", ";", "}", "public", "void", "handleFlying", "(", "Packet10Flying", "par1Packet10Flying", ")", "{", "registerPacket", "(", "par1Packet10Flying", ")", ";", "}", "public", "void", "handleMultiBlockChange", "(", "Packet52MultiBlockChange", "par1Packet52MultiBlockChange", ")", "{", "registerPacket", "(", "par1Packet52MultiBlockChange", ")", ";", "}", "public", "void", "handleBlockDig", "(", "Packet14BlockDig", "par1Packet14BlockDig", ")", "{", "registerPacket", "(", "par1Packet14BlockDig", ")", ";", "}", "public", "void", "handleBlockChange", "(", "Packet53BlockChange", "par1Packet53BlockChange", ")", "{", "registerPacket", "(", "par1Packet53BlockChange", ")", ";", "}", "public", "void", "handlePreChunk", "(", "Packet50PreChunk", "par1Packet50PreChunk", ")", "{", "registerPacket", "(", "par1Packet50PreChunk", ")", ";", "}", "public", "void", "handleNamedEntitySpawn", "(", "Packet20NamedEntitySpawn", "par1Packet20NamedEntitySpawn", ")", "{", "registerPacket", "(", "par1Packet20NamedEntitySpawn", ")", ";", "}", "public", "void", "handleEntity", "(", "Packet30Entity", "par1Packet30Entity", ")", "{", "registerPacket", "(", "par1Packet30Entity", ")", ";", "}", "public", "void", "handleEntityTeleport", "(", "Packet34EntityTeleport", "par1Packet34EntityTeleport", ")", "{", "registerPacket", "(", "par1Packet34EntityTeleport", ")", ";", "}", "public", "void", "handlePlace", "(", "Packet15Place", "par1Packet15Place", ")", "{", "registerPacket", "(", "par1Packet15Place", ")", ";", "}", "public", "void", "handleBlockItemSwitch", "(", "Packet16BlockItemSwitch", "par1Packet16BlockItemSwitch", ")", "{", "registerPacket", "(", "par1Packet16BlockItemSwitch", ")", ";", "}", "public", "void", "handleDestroyEntity", "(", "Packet29DestroyEntity", "par1Packet29DestroyEntity", ")", "{", "registerPacket", "(", "par1Packet29DestroyEntity", ")", ";", "}", "public", "void", "handlePickupSpawn", "(", "Packet21PickupSpawn", "par1Packet21PickupSpawn", ")", "{", "registerPacket", "(", "par1Packet21PickupSpawn", ")", ";", "}", "public", "void", "handleCollect", "(", "Packet22Collect", "par1Packet22Collect", ")", "{", "registerPacket", "(", "par1Packet22Collect", ")", ";", "}", "public", "void", "handleChat", "(", "Packet3Chat", "par1Packet3Chat", ")", "{", "registerPacket", "(", "par1Packet3Chat", ")", ";", "}", "public", "void", "handleVehicleSpawn", "(", "Packet23VehicleSpawn", "par1Packet23VehicleSpawn", ")", "{", "registerPacket", "(", "par1Packet23VehicleSpawn", ")", ";", "}", "public", "void", "handleAnimation", "(", "Packet18Animation", "par1Packet18Animation", ")", "{", "registerPacket", "(", "par1Packet18Animation", ")", ";", "}", "public", "void", "handleEntityAction", "(", "Packet19EntityAction", "par1Packet19EntityAction", ")", "{", "registerPacket", "(", "par1Packet19EntityAction", ")", ";", "}", "public", "void", "handleHandshake", "(", "Packet2Handshake", "par1Packet2Handshake", ")", "{", "registerPacket", "(", "par1Packet2Handshake", ")", ";", "}", "public", "void", "handleMobSpawn", "(", "Packet24MobSpawn", "par1Packet24MobSpawn", ")", "{", "registerPacket", "(", "par1Packet24MobSpawn", ")", ";", "}", "public", "void", "handleUpdateTime", "(", "Packet4UpdateTime", "par1Packet4UpdateTime", ")", "{", "registerPacket", "(", "par1Packet4UpdateTime", ")", ";", "}", "public", "void", "handleSpawnPosition", "(", "Packet6SpawnPosition", "par1Packet6SpawnPosition", ")", "{", "registerPacket", "(", "par1Packet6SpawnPosition", ")", ";", "}", "public", "void", "handleEntityVelocity", "(", "Packet28EntityVelocity", "par1Packet28EntityVelocity", ")", "{", "registerPacket", "(", "par1Packet28EntityVelocity", ")", ";", "}", "public", "void", "handleEntityMetadata", "(", "Packet40EntityMetadata", "par1Packet40EntityMetadata", ")", "{", "registerPacket", "(", "par1Packet40EntityMetadata", ")", ";", "}", "public", "void", "handleAttachEntity", "(", "Packet39AttachEntity", "par1Packet39AttachEntity", ")", "{", "registerPacket", "(", "par1Packet39AttachEntity", ")", ";", "}", "public", "void", "handleUseEntity", "(", "Packet7UseEntity", "par1Packet7UseEntity", ")", "{", "registerPacket", "(", "par1Packet7UseEntity", ")", ";", "}", "public", "void", "handleEntityStatus", "(", "Packet38EntityStatus", "par1Packet38EntityStatus", ")", "{", "registerPacket", "(", "par1Packet38EntityStatus", ")", ";", "}", "public", "void", "handleUpdateHealth", "(", "Packet8UpdateHealth", "par1Packet8UpdateHealth", ")", "{", "registerPacket", "(", "par1Packet8UpdateHealth", ")", ";", "}", "public", "void", "handleRespawn", "(", "Packet9Respawn", "par1Packet9Respawn", ")", "{", "registerPacket", "(", "par1Packet9Respawn", ")", ";", "}", "public", "void", "handleExplosion", "(", "Packet60Explosion", "par1Packet60Explosion", ")", "{", "registerPacket", "(", "par1Packet60Explosion", ")", ";", "}", "public", "void", "handleOpenWindow", "(", "Packet100OpenWindow", "par1Packet100OpenWindow", ")", "{", "registerPacket", "(", "par1Packet100OpenWindow", ")", ";", "}", "public", "void", "handleCloseWindow", "(", "Packet101CloseWindow", "par1Packet101CloseWindow", ")", "{", "registerPacket", "(", "par1Packet101CloseWindow", ")", ";", "}", "public", "void", "handleWindowClick", "(", "Packet102WindowClick", "par1Packet102WindowClick", ")", "{", "registerPacket", "(", "par1Packet102WindowClick", ")", ";", "}", "public", "void", "handleSetSlot", "(", "Packet103SetSlot", "par1Packet103SetSlot", ")", "{", "registerPacket", "(", "par1Packet103SetSlot", ")", ";", "}", "public", "void", "handleWindowItems", "(", "Packet104WindowItems", "par1Packet104WindowItems", ")", "{", "registerPacket", "(", "par1Packet104WindowItems", ")", ";", "}", "public", "void", "handleUpdateSign", "(", "Packet130UpdateSign", "par1Packet130UpdateSign", ")", "{", "registerPacket", "(", "par1Packet130UpdateSign", ")", ";", "}", "public", "void", "handleUpdateProgressbar", "(", "Packet105UpdateProgressbar", "par1Packet105UpdateProgressbar", ")", "{", "registerPacket", "(", "par1Packet105UpdateProgressbar", ")", ";", "}", "public", "void", "handlePlayerInventory", "(", "Packet5PlayerInventory", "par1Packet5PlayerInventory", ")", "{", "registerPacket", "(", "par1Packet5PlayerInventory", ")", ";", "}", "public", "void", "handleTransaction", "(", "Packet106Transaction", "par1Packet106Transaction", ")", "{", "registerPacket", "(", "par1Packet106Transaction", ")", ";", "}", "public", "void", "handleEntityPainting", "(", "Packet25EntityPainting", "par1Packet25EntityPainting", ")", "{", "registerPacket", "(", "par1Packet25EntityPainting", ")", ";", "}", "public", "void", "handlePlayNoteBlock", "(", "Packet54PlayNoteBlock", "par1Packet54PlayNoteBlock", ")", "{", "registerPacket", "(", "par1Packet54PlayNoteBlock", ")", ";", "}", "public", "void", "handleStatistic", "(", "Packet200Statistic", "par1Packet200Statistic", ")", "{", "registerPacket", "(", "par1Packet200Statistic", ")", ";", "}", "public", "void", "handleSleep", "(", "Packet17Sleep", "par1Packet17Sleep", ")", "{", "registerPacket", "(", "par1Packet17Sleep", ")", ";", "}", "public", "void", "handleBed", "(", "Packet70Bed", "par1Packet70Bed", ")", "{", "registerPacket", "(", "par1Packet70Bed", ")", ";", "}", "public", "void", "handleWeather", "(", "Packet71Weather", "par1Packet71Weather", ")", "{", "registerPacket", "(", "par1Packet71Weather", ")", ";", "}", "public", "void", "handleMapData", "(", "Packet131MapData", "par1Packet131MapData", ")", "{", "registerPacket", "(", "par1Packet131MapData", ")", ";", "}", "public", "void", "handleDoorChange", "(", "Packet61DoorChange", "par1Packet61DoorChange", ")", "{", "registerPacket", "(", "par1Packet61DoorChange", ")", ";", "}", "public", "void", "handleServerPing", "(", "Packet254ServerPing", "par1Packet254ServerPing", ")", "{", "registerPacket", "(", "par1Packet254ServerPing", ")", ";", "}", "public", "void", "handleEntityEffect", "(", "Packet41EntityEffect", "par1Packet41EntityEffect", ")", "{", "registerPacket", "(", "par1Packet41EntityEffect", ")", ";", "}", "public", "void", "handleRemoveEntityEffect", "(", "Packet42RemoveEntityEffect", "par1Packet42RemoveEntityEffect", ")", "{", "registerPacket", "(", "par1Packet42RemoveEntityEffect", ")", ";", "}", "public", "void", "handlePlayerInfo", "(", "Packet201PlayerInfo", "par1Packet201PlayerInfo", ")", "{", "registerPacket", "(", "par1Packet201PlayerInfo", ")", ";", "}", "public", "void", "handleKeepAlive", "(", "Packet0KeepAlive", "par1Packet0KeepAlive", ")", "{", "registerPacket", "(", "par1Packet0KeepAlive", ")", ";", "}", "public", "void", "handleExperience", "(", "Packet43Experience", "par1Packet43Experience", ")", "{", "registerPacket", "(", "par1Packet43Experience", ")", ";", "}", "public", "void", "handleCreativeSetSlot", "(", "Packet107CreativeSetSlot", "par1Packet107CreativeSetSlot", ")", "{", "registerPacket", "(", "par1Packet107CreativeSetSlot", ")", ";", "}", "public", "void", "handleEntityExpOrb", "(", "Packet26EntityExpOrb", "par1Packet26EntityExpOrb", ")", "{", "registerPacket", "(", "par1Packet26EntityExpOrb", ")", ";", "}", "public", "void", "handleEnchantItem", "(", "Packet108EnchantItem", "packet108enchantitem", ")", "{", "}", "public", "void", "handleCustomPayload", "(", "Packet250CustomPayload", "packet250custompayload", ")", "{", "}", "public", "void", "handleEntityHeadRotation", "(", "Packet35EntityHeadRotation", "par1Packet35EntityHeadRotation", ")", "{", "registerPacket", "(", "par1Packet35EntityHeadRotation", ")", ";", "}", "public", "void", "handleTileEntityData", "(", "Packet132TileEntityData", "par1Packet132TileEntityData", ")", "{", "registerPacket", "(", "par1Packet132TileEntityData", ")", ";", "}", "public", "void", "func_50003_a", "(", "Packet202PlayerAbilities", "par1Packet202PlayerAbilities", ")", "{", "registerPacket", "(", "par1Packet202PlayerAbilities", ")", ";", "}", "}", "</s>" ]
9,942
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "EnchantmentArrowFire", "extends", "Enchantment", "{", "public", "EnchantmentArrowFire", "(", "int", "par1", ",", "int", "par2", ")", "{", "super", "(", "par1", ",", "par2", ",", "EnumEnchantmentType", ".", "bow", ")", ";", "setName", "(", "\"arrowFire\"", ")", ";", "}", "public", "int", "getMinEnchantability", "(", "int", "par1", ")", "{", "return", "20", ";", "}", "public", "int", "getMaxEnchantability", "(", "int", "par1", ")", "{", "return", "50", ";", "}", "public", "int", "getMaxLevel", "(", ")", "{", "return", "1", ";", "}", "}", "</s>" ]
9,943
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "List", ";", "public", "interface", "ICrafting", "{", "public", "abstract", "void", "updateCraftingInventory", "(", "Container", "container", ",", "List", "list", ")", ";", "public", "abstract", "void", "updateCraftingInventorySlot", "(", "Container", "container", ",", "int", "i", ",", "ItemStack", "itemstack", ")", ";", "public", "abstract", "void", "updateCraftingInventoryInfo", "(", "Container", "container", ",", "int", "i", ",", "int", "j", ")", ";", "}", "</s>" ]
9,944
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "ExtendedBlockStorage", "{", "private", "int", "yBase", ";", "private", "int", "blockRefCount", ";", "private", "int", "tickRefCount", ";", "private", "byte", "blockLSBArray", "[", "]", ";", "private", "NibbleArray", "blockMSBArray", ";", "private", "NibbleArray", "blockMetadataArray", ";", "private", "NibbleArray", "blocklightArray", ";", "private", "NibbleArray", "skylightArray", ";", "public", "ExtendedBlockStorage", "(", "int", "par1", ")", "{", "yBase", "=", "par1", ";", "blockLSBArray", "=", "new", "byte", "[", "4096", "]", ";", "blockMetadataArray", "=", "new", "NibbleArray", "(", "blockLSBArray", ".", "length", ",", "4", ")", ";", "skylightArray", "=", "new", "NibbleArray", "(", "blockLSBArray", ".", "length", ",", "4", ")", ";", "blocklightArray", "=", "new", "NibbleArray", "(", "blockLSBArray", ".", "length", ",", "4", ")", ";", "}", "public", "int", "getExtBlockID", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "int", "i", "=", "blockLSBArray", "[", "par2", "<<", "8", "|", "par3", "<<", "4", "|", "par1", "]", "&", "0xff", ";", "if", "(", "blockMSBArray", "!=", "null", ")", "{", "return", "blockMSBArray", ".", "get", "(", "par1", ",", "par2", ",", "par3", ")", "<<", "8", "|", "i", ";", "}", "else", "{", "return", "i", ";", "}", "}", "public", "void", "setExtBlockID", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "int", "i", "=", "blockLSBArray", "[", "par2", "<<", "8", "|", "par3", "<<", "4", "|", "par1", "]", "&", "0xff", ";", "if", "(", "blockMSBArray", "!=", "null", ")", "{", "i", "=", "blockMSBArray", ".", "get", "(", "par1", ",", "par2", ",", "par3", ")", "<<", "8", "|", "i", ";", "}", "if", "(", "i", "==", "0", "&&", "par4", "!=", "0", ")", "{", "blockRefCount", "++", ";", "if", "(", "Block", ".", "blocksList", "[", "par4", "]", "!=", "null", "&&", "Block", ".", "blocksList", "[", "par4", "]", ".", "getTickRandomly", "(", ")", ")", "{", "tickRefCount", "++", ";", "}", "}", "else", "if", "(", "i", "!=", "0", "&&", "par4", "==", "0", ")", "{", "blockRefCount", "--", ";", "if", "(", "Block", ".", "blocksList", "[", "i", "]", "!=", "null", "&&", "Block", ".", "blocksList", "[", "i", "]", ".", "getTickRandomly", "(", ")", ")", "{", "tickRefCount", "--", ";", "}", "}", "else", "if", "(", "Block", ".", "blocksList", "[", "i", "]", "!=", "null", "&&", "Block", ".", "blocksList", "[", "i", "]", ".", "getTickRandomly", "(", ")", "&&", "(", "Block", ".", "blocksList", "[", "par4", "]", "==", "null", "||", "!", "Block", ".", "blocksList", "[", "par4", "]", ".", "getTickRandomly", "(", ")", ")", ")", "{", "tickRefCount", "--", ";", "}", "else", "if", "(", "(", "Block", ".", "blocksList", "[", "i", "]", "==", "null", "||", "!", "Block", ".", "blocksList", "[", "i", "]", ".", "getTickRandomly", "(", ")", ")", "&&", "Block", ".", "blocksList", "[", "par4", "]", "!=", "null", "&&", "Block", ".", "blocksList", "[", "par4", "]", ".", "getTickRandomly", "(", ")", ")", "{", "tickRefCount", "++", ";", "}", "blockLSBArray", "[", "par2", "<<", "8", "|", "par3", "<<", "4", "|", "par1", "]", "=", "(", "byte", ")", "(", "par4", "&", "0xff", ")", ";", "if", "(", "par4", ">", "255", ")", "{", "if", "(", "blockMSBArray", "==", "null", ")", "{", "blockMSBArray", "=", "new", "NibbleArray", "(", "blockLSBArray", ".", "length", ",", "4", ")", ";", "}", "blockMSBArray", ".", "set", "(", "par1", ",", "par2", ",", "par3", ",", "(", "par4", "&", "0xf00", ")", ">>", "8", ")", ";", "}", "else", "if", "(", "blockMSBArray", "!=", "null", ")", "{", "blockMSBArray", ".", "set", "(", "par1", ",", "par2", ",", "par3", ",", "0", ")", ";", "}", "}", "public", "int", "getExtBlockMetadata", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "return", "blockMetadataArray", ".", "get", "(", "par1", ",", "par2", ",", "par3", ")", ";", "}", "public", "void", "setExtBlockMetadata", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "blockMetadataArray", ".", "set", "(", "par1", ",", "par2", ",", "par3", ",", "par4", ")", ";", "}", "public", "boolean", "getIsEmpty", "(", ")", "{", "return", "blockRefCount", "==", "0", ";", "}", "public", "boolean", "getNeedsRandomTick", "(", ")", "{", "return", "tickRefCount", ">", "0", ";", "}", "public", "int", "getYLocation", "(", ")", "{", "return", "yBase", ";", "}", "public", "void", "setExtSkylightValue", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "skylightArray", ".", "set", "(", "par1", ",", "par2", ",", "par3", ",", "par4", ")", ";", "}", "public", "int", "getExtSkylightValue", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "return", "skylightArray", ".", "get", "(", "par1", ",", "par2", ",", "par3", ")", ";", "}", "public", "void", "setExtBlocklightValue", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ")", "{", "blocklightArray", ".", "set", "(", "par1", ",", "par2", ",", "par3", ",", "par4", ")", ";", "}", "public", "int", "getExtBlocklightValue", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "return", "blocklightArray", ".", "get", "(", "par1", ",", "par2", ",", "par3", ")", ";", "}", "public", "void", "func_48599_d", "(", ")", "{", "blockRefCount", "=", "0", ";", "tickRefCount", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "16", ";", "i", "++", ")", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<", "16", ";", "j", "++", ")", "{", "for", "(", "int", "k", "=", "0", ";", "k", "<", "16", ";", "k", "++", ")", "{", "int", "l", "=", "getExtBlockID", "(", "i", ",", "j", ",", "k", ")", ";", "if", "(", "l", "<=", "0", ")", "{", "continue", ";", "}", "if", "(", "Block", ".", "blocksList", "[", "l", "]", "==", "null", ")", "{", "blockLSBArray", "[", "j", "<<", "8", "|", "k", "<<", "4", "|", "i", "]", "=", "0", ";", "if", "(", "blockMSBArray", "!=", "null", ")", "{", "blockMSBArray", ".", "set", "(", "i", ",", "j", ",", "k", ",", "0", ")", ";", "}", "continue", ";", "}", "blockRefCount", "++", ";", "if", "(", "Block", ".", "blocksList", "[", "l", "]", ".", "getTickRandomly", "(", ")", ")", "{", "tickRefCount", "++", ";", "}", "}", "}", "}", "}", "public", "void", "func_48603_e", "(", ")", "{", "}", "public", "int", "func_48587_f", "(", ")", "{", "return", "blockRefCount", ";", "}", "public", "byte", "[", "]", "func_48590_g", "(", ")", "{", "return", "blockLSBArray", ";", "}", "public", "NibbleArray", "getBlockMSBArray", "(", ")", "{", "return", "blockMSBArray", ";", "}", "public", "NibbleArray", "func_48594_i", "(", ")", "{", "return", "blockMetadataArray", ";", "}", "public", "NibbleArray", "getBlocklightArray", "(", ")", "{", "return", "blocklightArray", ";", "}", "public", "NibbleArray", "getSkylightArray", "(", ")", "{", "return", "skylightArray", ";", "}", "public", "void", "setBlockLSBArray", "(", "byte", "par1ArrayOfByte", "[", "]", ")", "{", "blockLSBArray", "=", "par1ArrayOfByte", ";", "}", "public", "void", "setBlockMSBArray", "(", "NibbleArray", "par1NibbleArray", ")", "{", "blockMSBArray", "=", "par1NibbleArray", ";", "}", "public", "void", "setBlockMetadataArray", "(", "NibbleArray", "par1NibbleArray", ")", "{", "blockMetadataArray", "=", "par1NibbleArray", ";", "}", "public", "void", "setBlocklightArray", "(", "NibbleArray", "par1NibbleArray", ")", "{", "blocklightArray", "=", "par1NibbleArray", ";", "}", "public", "void", "setSkylightArray", "(", "NibbleArray", "par1NibbleArray", ")", "{", "skylightArray", "=", "par1NibbleArray", ";", "}", "}", "</s>" ]
9,945
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "Random", ";", "public", "class", "TileEntityDispenser", "extends", "TileEntity", "implements", "IInventory", "{", "private", "ItemStack", "dispenserContents", "[", "]", ";", "private", "Random", "dispenserRandom", ";", "public", "TileEntityDispenser", "(", ")", "{", "dispenserContents", "=", "new", "ItemStack", "[", "9", "]", ";", "dispenserRandom", "=", "new", "Random", "(", ")", ";", "}", "public", "int", "getSizeInventory", "(", ")", "{", "return", "9", ";", "}", "public", "ItemStack", "getStackInSlot", "(", "int", "par1", ")", "{", "return", "dispenserContents", "[", "par1", "]", ";", "}", "public", "ItemStack", "decrStackSize", "(", "int", "par1", ",", "int", "par2", ")", "{", "if", "(", "dispenserContents", "[", "par1", "]", "!=", "null", ")", "{", "if", "(", "dispenserContents", "[", "par1", "]", ".", "stackSize", "<=", "par2", ")", "{", "ItemStack", "itemstack", "=", "dispenserContents", "[", "par1", "]", ";", "dispenserContents", "[", "par1", "]", "=", "null", ";", "onInventoryChanged", "(", ")", ";", "return", "itemstack", ";", "}", "ItemStack", "itemstack1", "=", "dispenserContents", "[", "par1", "]", ".", "splitStack", "(", "par2", ")", ";", "if", "(", "dispenserContents", "[", "par1", "]", ".", "stackSize", "==", "0", ")", "{", "dispenserContents", "[", "par1", "]", "=", "null", ";", "}", "onInventoryChanged", "(", ")", ";", "return", "itemstack1", ";", "}", "else", "{", "return", "null", ";", "}", "}", "public", "ItemStack", "getStackInSlotOnClosing", "(", "int", "par1", ")", "{", "if", "(", "dispenserContents", "[", "par1", "]", "!=", "null", ")", "{", "ItemStack", "itemstack", "=", "dispenserContents", "[", "par1", "]", ";", "dispenserContents", "[", "par1", "]", "=", "null", ";", "return", "itemstack", ";", "}", "else", "{", "return", "null", ";", "}", "}", "public", "ItemStack", "getRandomStackFromInventory", "(", ")", "{", "int", "i", "=", "-", "1", ";", "int", "j", "=", "1", ";", "for", "(", "int", "k", "=", "0", ";", "k", "<", "dispenserContents", ".", "length", ";", "k", "++", ")", "{", "if", "(", "dispenserContents", "[", "k", "]", "!=", "null", "&&", "dispenserRandom", ".", "nextInt", "(", "j", "++", ")", "==", "0", ")", "{", "i", "=", "k", ";", "}", "}", "if", "(", "i", ">=", "0", ")", "{", "return", "decrStackSize", "(", "i", ",", "1", ")", ";", "}", "else", "{", "return", "null", ";", "}", "}", "public", "void", "setInventorySlotContents", "(", "int", "par1", ",", "ItemStack", "par2ItemStack", ")", "{", "dispenserContents", "[", "par1", "]", "=", "par2ItemStack", ";", "if", "(", "par2ItemStack", "!=", "null", "&&", "par2ItemStack", ".", "stackSize", ">", "getInventoryStackLimit", "(", ")", ")", "{", "par2ItemStack", ".", "stackSize", "=", "getInventoryStackLimit", "(", ")", ";", "}", "onInventoryChanged", "(", ")", ";", "}", "public", "String", "getInvName", "(", ")", "{", "return", "\"\"", ";", "}", "public", "void", "readFromNBT", "(", "NBTTagCompound", "par1NBTTagCompound", ")", "{", "super", ".", "readFromNBT", "(", "par1NBTTagCompound", ")", ";", "NBTTagList", "nbttaglist", "=", "par1NBTTagCompound", ".", "getTagList", "(", "\"Items\"", ")", ";", "dispenserContents", "=", "new", "ItemStack", "[", "getSizeInventory", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "nbttaglist", ".", "tagCount", "(", ")", ";", "i", "++", ")", "{", "NBTTagCompound", "nbttagcompound", "=", "(", "NBTTagCompound", ")", "nbttaglist", ".", "tagAt", "(", "i", ")", ";", "int", "j", "=", "nbttagcompound", ".", "getByte", "(", "\"Slot\"", ")", "&", "0xff", ";", "if", "(", "j", ">=", "0", "&&", "j", "<", "dispenserContents", ".", "length", ")", "{", "dispenserContents", "[", "j", "]", "=", "ItemStack", ".", "loadItemStackFromNBT", "(", "nbttagcompound", ")", ";", "}", "}", "}", "public", "void", "writeToNBT", "(", "NBTTagCompound", "par1NBTTagCompound", ")", "{", "super", ".", "writeToNBT", "(", "par1NBTTagCompound", ")", ";", "NBTTagList", "nbttaglist", "=", "new", "NBTTagList", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "dispenserContents", ".", "length", ";", "i", "++", ")", "{", "if", "(", "dispenserContents", "[", "i", "]", "!=", "null", ")", "{", "NBTTagCompound", "nbttagcompound", "=", "new", "NBTTagCompound", "(", ")", ";", "nbttagcompound", ".", "setByte", "(", "\"Slot\"", ",", "(", "byte", ")", "i", ")", ";", "dispenserContents", "[", "i", "]", ".", "writeToNBT", "(", "nbttagcompound", ")", ";", "nbttaglist", ".", "appendTag", "(", "nbttagcompound", ")", ";", "}", "}", "par1NBTTagCompound", ".", "setTag", "(", "\"Items\"", ",", "nbttaglist", ")", ";", "}", "public", "int", "getInventoryStackLimit", "(", ")", "{", "return", "64", ";", "}", "public", "boolean", "isUseableByPlayer", "(", "EntityPlayer", "par1EntityPlayer", ")", "{", "if", "(", "worldObj", ".", "getBlockTileEntity", "(", "xCoord", ",", "yCoord", ",", "zCoord", ")", "!=", "this", ")", "{", "return", "false", ";", "}", "return", "par1EntityPlayer", ".", "getDistanceSq", "(", "(", "double", ")", "xCoord", "+", "0.5D", ",", "(", "double", ")", "yCoord", "+", "0.5D", ",", "(", "double", ")", "zCoord", "+", "0.5D", ")", "<=", "64D", ";", "}", "public", "void", "openChest", "(", ")", "{", "}", "public", "void", "closeChest", "(", ")", "{", "}", "}", "</s>" ]
9,946
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "Random", ";", "public", "class", "ItemEgg", "extends", "Item", "{", "public", "ItemEgg", "(", "int", "par1", ")", "{", "super", "(", "par1", ")", ";", "maxStackSize", "=", "16", ";", "}", "public", "ItemStack", "onItemRightClick", "(", "ItemStack", "par1ItemStack", ",", "World", "par2World", ",", "EntityPlayer", "par3EntityPlayer", ")", "{", "if", "(", "!", "par3EntityPlayer", ".", "capabilities", ".", "isCreativeMode", ")", "{", "par1ItemStack", ".", "stackSize", "--", ";", "}", "par2World", ".", "playSoundAtEntity", "(", "par3EntityPlayer", ",", "\"random.bow\"", ",", "0.5F", ",", "0.4F", "/", "(", "itemRand", ".", "nextFloat", "(", ")", "*", "0.4F", "+", "0.8F", ")", ")", ";", "if", "(", "!", "par2World", ".", "isRemote", ")", "{", "par2World", ".", "spawnEntityInWorld", "(", "new", "EntityEgg", "(", "par2World", ",", "par3EntityPlayer", ")", ")", ";", "}", "return", "par1ItemStack", ";", "}", "}", "</s>" ]
9,947
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "enum", "EnumEnchantmentType", "{", "all", ",", "armor", ",", "armor_feet", ",", "armor_legs", ",", "armor_torso", ",", "armor_head", ",", "weapon", ",", "digger", ",", "bow", ";", "public", "boolean", "canEnchantItem", "(", "Item", "par1Item", ")", "{", "if", "(", "this", "==", "all", ")", "{", "return", "true", ";", "}", "if", "(", "par1Item", "instanceof", "ItemArmor", ")", "{", "if", "(", "this", "==", "armor", ")", "{", "return", "true", ";", "}", "ItemArmor", "itemarmor", "=", "(", "ItemArmor", ")", "par1Item", ";", "if", "(", "itemarmor", ".", "armorType", "==", "0", ")", "{", "return", "this", "==", "armor_head", ";", "}", "if", "(", "itemarmor", ".", "armorType", "==", "2", ")", "{", "return", "this", "==", "armor_legs", ";", "}", "if", "(", "itemarmor", ".", "armorType", "==", "1", ")", "{", "return", "this", "==", "armor_torso", ";", "}", "if", "(", "itemarmor", ".", "armorType", "==", "3", ")", "{", "return", "this", "==", "armor_feet", ";", "}", "else", "{", "return", "false", ";", "}", "}", "if", "(", "par1Item", "instanceof", "ItemSword", ")", "{", "return", "this", "==", "weapon", ";", "}", "if", "(", "par1Item", "instanceof", "ItemTool", ")", "{", "return", "this", "==", "digger", ";", "}", "if", "(", "par1Item", "instanceof", "ItemBow", ")", "{", "return", "this", "==", "bow", ";", "}", "else", "{", "return", "false", ";", "}", "}", "}", "</s>" ]
9,948
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "io", ".", "*", ";", "public", "class", "Packet70Bed", "extends", "Packet", "{", "public", "static", "final", "String", "bedChat", "[", "]", "=", "{", "\"\"", ",", "null", ",", "null", ",", "\"\"", "}", ";", "public", "int", "bedState", ";", "public", "int", "gameMode", ";", "public", "Packet70Bed", "(", ")", "{", "}", "public", "Packet70Bed", "(", "int", "par1", ",", "int", "par2", ")", "{", "bedState", "=", "par1", ";", "gameMode", "=", "par2", ";", "}", "public", "void", "readPacketData", "(", "DataInputStream", "par1DataInputStream", ")", "throws", "IOException", "{", "bedState", "=", "par1DataInputStream", ".", "readByte", "(", ")", ";", "gameMode", "=", "par1DataInputStream", ".", "readByte", "(", ")", ";", "}", "public", "void", "writePacketData", "(", "DataOutputStream", "par1DataOutputStream", ")", "throws", "IOException", "{", "par1DataOutputStream", ".", "writeByte", "(", "bedState", ")", ";", "par1DataOutputStream", ".", "writeByte", "(", "gameMode", ")", ";", "}", "public", "void", "processPacket", "(", "NetHandler", "par1NetHandler", ")", "{", "par1NetHandler", ".", "handleBed", "(", "this", ")", ";", "}", "public", "int", "getPacketSize", "(", ")", "{", "return", "2", ";", "}", "}", "</s>" ]
9,949
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "io", ".", "*", ";", "public", "class", "RConOutputStream", "{", "private", "ByteArrayOutputStream", "byteArrayOutput", ";", "private", "DataOutputStream", "output", ";", "public", "RConOutputStream", "(", "int", "par1", ")", "{", "byteArrayOutput", "=", "new", "ByteArrayOutputStream", "(", "par1", ")", ";", "output", "=", "new", "DataOutputStream", "(", "byteArrayOutput", ")", ";", "}", "public", "void", "writeByteArray", "(", "byte", "par1ArrayOfByte", "[", "]", ")", "throws", "IOException", "{", "output", ".", "write", "(", "par1ArrayOfByte", ",", "0", ",", "par1ArrayOfByte", ".", "length", ")", ";", "}", "public", "void", "writeString", "(", "String", "par1Str", ")", "throws", "IOException", "{", "output", ".", "writeBytes", "(", "par1Str", ")", ";", "output", ".", "write", "(", "0", ")", ";", "}", "public", "void", "writeInt", "(", "int", "par1", ")", "throws", "IOException", "{", "output", ".", "write", "(", "par1", ")", ";", "}", "public", "void", "writeShort", "(", "short", "par1", ")", "throws", "IOException", "{", "output", ".", "writeShort", "(", "Short", ".", "reverseBytes", "(", "par1", ")", ")", ";", "}", "public", "byte", "[", "]", "toByteArray", "(", ")", "{", "return", "byteArrayOutput", ".", "toByteArray", "(", ")", ";", "}", "public", "void", "reset", "(", ")", "{", "byteArrayOutput", ".", "reset", "(", ")", ";", "}", "}", "</s>" ]
9,950
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "ItemReed", "extends", "Item", "{", "private", "int", "spawnID", ";", "public", "ItemReed", "(", "int", "par1", ",", "Block", "par2Block", ")", "{", "super", "(", "par1", ")", ";", "spawnID", "=", "par2Block", ".", "blockID", ";", "}", "public", "boolean", "onItemUse", "(", "ItemStack", "par1ItemStack", ",", "EntityPlayer", "par2EntityPlayer", ",", "World", "par3World", ",", "int", "par4", ",", "int", "par5", ",", "int", "par6", ",", "int", "par7", ")", "{", "int", "i", "=", "par3World", ".", "getBlockId", "(", "par4", ",", "par5", ",", "par6", ")", ";", "if", "(", "i", "==", "Block", ".", "snow", ".", "blockID", ")", "{", "par7", "=", "1", ";", "}", "else", "if", "(", "i", "!=", "Block", ".", "vine", ".", "blockID", "&&", "i", "!=", "Block", ".", "tallGrass", ".", "blockID", "&&", "i", "!=", "Block", ".", "deadBush", ".", "blockID", ")", "{", "if", "(", "par7", "==", "0", ")", "{", "par5", "--", ";", "}", "if", "(", "par7", "==", "1", ")", "{", "par5", "++", ";", "}", "if", "(", "par7", "==", "2", ")", "{", "par6", "--", ";", "}", "if", "(", "par7", "==", "3", ")", "{", "par6", "++", ";", "}", "if", "(", "par7", "==", "4", ")", "{", "par4", "--", ";", "}", "if", "(", "par7", "==", "5", ")", "{", "par4", "++", ";", "}", "}", "if", "(", "!", "par2EntityPlayer", ".", "canPlayerEdit", "(", "par4", ",", "par5", ",", "par6", ")", ")", "{", "return", "false", ";", "}", "if", "(", "par1ItemStack", ".", "stackSize", "==", "0", ")", "{", "return", "false", ";", "}", "if", "(", "par3World", ".", "canBlockBePlacedAt", "(", "spawnID", ",", "par4", ",", "par5", ",", "par6", ",", "false", ",", "par7", ")", ")", "{", "Block", "block", "=", "Block", ".", "blocksList", "[", "spawnID", "]", ";", "if", "(", "par3World", ".", "setBlockWithNotify", "(", "par4", ",", "par5", ",", "par6", ",", "spawnID", ")", ")", "{", "if", "(", "par3World", ".", "getBlockId", "(", "par4", ",", "par5", ",", "par6", ")", "==", "spawnID", ")", "{", "Block", ".", "blocksList", "[", "spawnID", "]", ".", "onBlockPlaced", "(", "par3World", ",", "par4", ",", "par5", ",", "par6", ",", "par7", ")", ";", "Block", ".", "blocksList", "[", "spawnID", "]", ".", "onBlockPlacedBy", "(", "par3World", ",", "par4", ",", "par5", ",", "par6", ",", "par2EntityPlayer", ")", ";", "}", "par3World", ".", "playSoundEffect", "(", "(", "float", ")", "par4", "+", "0.5F", ",", "(", "float", ")", "par5", "+", "0.5F", ",", "(", "float", ")", "par6", "+", "0.5F", ",", "block", ".", "stepSound", ".", "getStepSound", "(", ")", ",", "(", "block", ".", "stepSound", ".", "getVolume", "(", ")", "+", "1.0F", ")", "/", "2.0F", ",", "block", ".", "stepSound", ".", "getPitch", "(", ")", "*", "0.8F", ")", ";", "par1ItemStack", ".", "stackSize", "--", ";", "}", "}", "return", "true", ";", "}", "}", "</s>" ]
9,951
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "EntityDragon", "extends", "EntityDragonBase", "{", "public", "double", "targetX", ";", "public", "double", "targetY", ";", "public", "double", "targetZ", ";", "public", "double", "field_40144_d", "[", "]", "[", "]", ";", "public", "int", "field_40145_e", ";", "public", "EntityDragonPart", "dragonPartArray", "[", "]", ";", "public", "EntityDragonPart", "dragonPartHead", ";", "public", "EntityDragonPart", "dragonPartBody", ";", "public", "EntityDragonPart", "dragonPartTail1", ";", "public", "EntityDragonPart", "dragonPartTail2", ";", "public", "EntityDragonPart", "dragonPartTail3", ";", "public", "EntityDragonPart", "dragonPartWing1", ";", "public", "EntityDragonPart", "dragonPartWing2", ";", "public", "float", "field_40149_n", ";", "public", "float", "field_40150_o", ";", "public", "boolean", "field_40160_p", ";", "public", "boolean", "field_40159_q", ";", "private", "Entity", "target", ";", "public", "int", "field_40158_r", ";", "public", "EntityEnderCrystal", "healingEnderCrystal", ";", "public", "EntityDragon", "(", "World", "par1World", ")", "{", "super", "(", "par1World", ")", ";", "field_40144_d", "=", "new", "double", "[", "64", "]", "[", "3", "]", ";", "field_40145_e", "=", "-", "1", ";", "field_40149_n", "=", "0.0F", ";", "field_40150_o", "=", "0.0F", ";", "field_40160_p", "=", "false", ";", "field_40159_q", "=", "false", ";", "field_40158_r", "=", "0", ";", "healingEnderCrystal", "=", "null", ";", "dragonPartArray", "=", "(", "new", "EntityDragonPart", "[", "]", "{", "dragonPartHead", "=", "new", "EntityDragonPart", "(", "this", ",", "\"head\"", ",", "6F", ",", "6F", ")", ",", "dragonPartBody", "=", "new", "EntityDragonPart", "(", "this", ",", "\"body\"", ",", "8F", ",", "8F", ")", ",", "dragonPartTail1", "=", "new", "EntityDragonPart", "(", "this", ",", "\"tail\"", ",", "4F", ",", "4F", ")", ",", "dragonPartTail2", "=", "new", "EntityDragonPart", "(", "this", ",", "\"tail\"", ",", "4F", ",", "4F", ")", ",", "dragonPartTail3", "=", "new", "EntityDragonPart", "(", "this", ",", "\"tail\"", ",", "4F", ",", "4F", ")", ",", "dragonPartWing1", "=", "new", "EntityDragonPart", "(", "this", ",", "\"wing\"", ",", "4F", ",", "4F", ")", ",", "dragonPartWing2", "=", "new", "EntityDragonPart", "(", "this", ",", "\"wing\"", ",", "4F", ",", "4F", ")", "}", ")", ";", "maxHealth", "=", "200", ";", "setEntityHealth", "(", "maxHealth", ")", ";", "texture", "=", "\"\"", ";", "setSize", "(", "16F", ",", "8F", ")", ";", "noClip", "=", "true", ";", "isImmuneToFire", "=", "true", ";", "targetY", "=", "100D", ";", "ignoreFrustumCheck", "=", "true", ";", "}", "protected", "void", "entityInit", "(", ")", "{", "super", ".", "entityInit", "(", ")", ";", "dataWatcher", ".", "addObject", "(", "16", ",", "new", "Integer", "(", "maxHealth", ")", ")", ";", "}", "public", "double", "[", "]", "func_40139_a", "(", "int", "par1", ",", "float", "par2", ")", "{", "if", "(", "health", "<=", "0", ")", "{", "par2", "=", "0.0F", ";", "}", "par2", "=", "1.0F", "-", "par2", ";", "int", "i", "=", "field_40145_e", "-", "par1", "*", "1", "&", "0x3f", ";", "int", "j", "=", "field_40145_e", "-", "par1", "*", "1", "-", "1", "&", "0x3f", ";", "double", "ad", "[", "]", "=", "new", "double", "[", "3", "]", ";", "double", "d", "=", "field_40144_d", "[", "i", "]", "[", "0", "]", ";", "double", "d1", ";", "for", "(", "d1", "=", "field_40144_d", "[", "j", "]", "[", "0", "]", "-", "d", ";", "d1", "<", "-", "180D", ";", "d1", "+=", "360D", ")", "{", "}", "for", "(", ";", "d1", ">=", "180D", ";", "d1", "-=", "360D", ")", "{", "}", "ad", "[", "0", "]", "=", "d", "+", "d1", "*", "(", "double", ")", "par2", ";", "d", "=", "field_40144_d", "[", "i", "]", "[", "1", "]", ";", "d1", "=", "field_40144_d", "[", "j", "]", "[", "1", "]", "-", "d", ";", "ad", "[", "1", "]", "=", "d", "+", "d1", "*", "(", "double", ")", "par2", ";", "ad", "[", "2", "]", "=", "field_40144_d", "[", "i", "]", "[", "2", "]", "+", "(", "field_40144_d", "[", "j", "]", "[", "2", "]", "-", "field_40144_d", "[", "i", "]", "[", "2", "]", ")", "*", "(", "double", ")", "par2", ";", "return", "ad", ";", "}", "public", "void", "onLivingUpdate", "(", ")", "{", "field_40149_n", "=", "field_40150_o", ";", "if", "(", "!", "worldObj", ".", "isRemote", ")", "{", "dataWatcher", ".", "updateObject", "(", "16", ",", "Integer", ".", "valueOf", "(", "health", ")", ")", ";", "}", "if", "(", "health", "<=", "0", ")", "{", "float", "f", "=", "(", "rand", ".", "nextFloat", "(", ")", "-", "0.5F", ")", "*", "8F", ";", "float", "f2", "=", "(", "rand", ".", "nextFloat", "(", ")", "-", "0.5F", ")", "*", "4F", ";", "float", "f4", "=", "(", "rand", ".", "nextFloat", "(", ")", "-", "0.5F", ")", "*", "8F", ";", "worldObj", ".", "spawnParticle", "(", "\"largeexplode\"", ",", "posX", "+", "(", "double", ")", "f", ",", "posY", "+", "2D", "+", "(", "double", ")", "f2", ",", "posZ", "+", "(", "double", ")", "f4", ",", "0.0D", ",", "0.0D", ",", "0.0D", ")", ";", "return", ";", "}", "updateDragonEnderCrystal", "(", ")", ";", "float", "f1", "=", "0.2F", "/", "(", "MathHelper", ".", "sqrt_double", "(", "motionX", "*", "motionX", "+", "motionZ", "*", "motionZ", ")", "*", "10F", "+", "1.0F", ")", ";", "f1", "*=", "(", "float", ")", "Math", ".", "pow", "(", "2D", ",", "motionY", ")", ";", "if", "(", "field_40159_q", ")", "{", "field_40150_o", "+=", "f1", "*", "0.5F", ";", "}", "else", "{", "field_40150_o", "+=", "f1", ";", "}", "for", "(", ";", "rotationYaw", ">=", "180F", ";", "rotationYaw", "-=", "360F", ")", "{", "}", "for", "(", ";", "rotationYaw", "<", "-", "180F", ";", "rotationYaw", "+=", "360F", ")", "{", "}", "if", "(", "field_40145_e", "<", "0", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "field_40144_d", ".", "length", ";", "i", "++", ")", "{", "field_40144_d", "[", "i", "]", "[", "0", "]", "=", "rotationYaw", ";", "field_40144_d", "[", "i", "]", "[", "1", "]", "=", "posY", ";", "}", "}", "if", "(", "++", "field_40145_e", "==", "field_40144_d", ".", "length", ")", "{", "field_40145_e", "=", "0", ";", "}", "field_40144_d", "[", "field_40145_e", "]", "[", "0", "]", "=", "rotationYaw", ";", "field_40144_d", "[", "field_40145_e", "]", "[", "1", "]", "=", "posY", ";", "if", "(", "worldObj", ".", "isRemote", ")", "{", "if", "(", "newPosRotationIncrements", ">", "0", ")", "{", "double", "d", "=", "posX", "+", "(", "newPosX", "-", "posX", ")", "/", "(", "double", ")", "newPosRotationIncrements", ";", "double", "d2", "=", "posY", "+", "(", "newPosY", "-", "posY", ")", "/", "(", "double", ")", "newPosRotationIncrements", ";", "double", "d4", "=", "posZ", "+", "(", "newPosZ", "-", "posZ", ")", "/", "(", "double", ")", "newPosRotationIncrements", ";", "double", "d6", ";", "for", "(", "d6", "=", "newRotationYaw", "-", "(", "double", ")", "rotationYaw", ";", "d6", "<", "-", "180D", ";", "d6", "+=", "360D", ")", "{", "}", "for", "(", ";", "d6", ">=", "180D", ";", "d6", "-=", "360D", ")", "{", "}", "rotationYaw", "+=", "d6", "/", "(", "double", ")", "newPosRotationIncrements", ";", "rotationPitch", "+=", "(", "newRotationPitch", "-", "(", "double", ")", "rotationPitch", ")", "/", "(", "double", ")", "newPosRotationIncrements", ";", "newPosRotationIncrements", "--", ";", "setPosition", "(", "d", ",", "d2", ",", "d4", ")", ";", "setRotation", "(", "rotationYaw", ",", "rotationPitch", ")", ";", "}", "}", "else", "{", "double", "d1", "=", "targetX", "-", "posX", ";", "double", "d3", "=", "targetY", "-", "posY", ";", "double", "d5", "=", "targetZ", "-", "posZ", ";", "double", "d7", "=", "d1", "*", "d1", "+", "d3", "*", "d3", "+", "d5", "*", "d5", ";", "if", "(", "target", "!=", "null", ")", "{", "targetX", "=", "target", ".", "posX", ";", "targetZ", "=", "target", ".", "posZ", ";", "double", "d8", "=", "targetX", "-", "posX", ";", "double", "d10", "=", "targetZ", "-", "posZ", ";", "double", "d12", "=", "Math", ".", "sqrt", "(", "d8", "*", "d8", "+", "d10", "*", "d10", ")", ";", "double", "d13", "=", "(", "0.40000000596046448D", "+", "d12", "/", "80D", ")", "-", "1.0D", ";", "if", "(", "d13", ">", "10D", ")", "{", "d13", "=", "10D", ";", "}", "targetY", "=", "target", ".", "boundingBox", ".", "minY", "+", "d13", ";", "}", "else", "{", "targetX", "+=", "rand", ".", "nextGaussian", "(", ")", "*", "2D", ";", "targetZ", "+=", "rand", ".", "nextGaussian", "(", ")", "*", "2D", ";", "}", "if", "(", "field_40160_p", "||", "d7", "<", "100D", "||", "d7", ">", "22500D", "||", "isCollidedHorizontally", "||", "isCollidedVertically", ")", "{", "func_41037_w", "(", ")", ";", "}", "d3", "/=", "MathHelper", ".", "sqrt_double", "(", "d1", "*", "d1", "+", "d5", "*", "d5", ")", ";", "float", "f10", "=", "0.6F", ";", "if", "(", "d3", "<", "(", "double", ")", "(", "-", "f10", ")", ")", "{", "d3", "=", "-", "f10", ";", "}", "if", "(", "d3", ">", "(", "double", ")", "f10", ")", "{", "d3", "=", "f10", ";", "}", "motionY", "+=", "d3", "*", "0.10000000149011612D", ";", "for", "(", ";", "rotationYaw", "<", "-", "180F", ";", "rotationYaw", "+=", "360F", ")", "{", "}", "for", "(", ";", "rotationYaw", ">=", "180F", ";", "rotationYaw", "-=", "360F", ")", "{", "}", "double", "d9", "=", "180D", "-", "(", "Math", ".", "atan2", "(", "d1", ",", "d5", ")", "*", "180D", ")", "/", "Math", ".", "PI", ";", "double", "d11", ";", "for", "(", "d11", "=", "d9", "-", "(", "double", ")", "rotationYaw", ";", "d11", "<", "-", "180D", ";", "d11", "+=", "360D", ")", "{", "}", "for", "(", ";", "d11", ">=", "180D", ";", "d11", "-=", "360D", ")", "{", "}", "if", "(", "d11", ">", "50D", ")", "{", "d11", "=", "50D", ";", "}", "if", "(", "d11", "<", "-", "50D", ")", "{", "d11", "=", "-", "50D", ";", "}", "Vec3D", "vec3d", "=", "Vec3D", ".", "createVector", "(", "targetX", "-", "posX", ",", "targetY", "-", "posY", ",", "targetZ", "-", "posZ", ")", ".", "normalize", "(", ")", ";", "Vec3D", "vec3d1", "=", "Vec3D", ".", "createVector", "(", "MathHelper", ".", "sin", "(", "(", "rotationYaw", "*", "(", "float", ")", "Math", ".", "PI", ")", "/", "180F", ")", ",", "motionY", ",", "-", "MathHelper", ".", "cos", "(", "(", "rotationYaw", "*", "(", "float", ")", "Math", ".", "PI", ")", "/", "180F", ")", ")", ".", "normalize", "(", ")", ";", "float", "f18", "=", "(", "float", ")", "(", "vec3d1", ".", "dotProduct", "(", "vec3d", ")", "+", "0.5D", ")", "/", "1.5F", ";", "if", "(", "f18", "<", "0.0F", ")", "{", "f18", "=", "0.0F", ";", "}", "randomYawVelocity", "*=", "0.8F", ";", "float", "f19", "=", "MathHelper", ".", "sqrt_double", "(", "motionX", "*", "motionX", "+", "motionZ", "*", "motionZ", ")", "*", "1.0F", "+", "1.0F", ";", "double", "d14", "=", "Math", ".", "sqrt", "(", "motionX", "*", "motionX", "+", "motionZ", "*", "motionZ", ")", "*", "1.0D", "+", "1.0D", ";", "if", "(", "d14", ">", "40D", ")", "{", "d14", "=", "40D", ";", "}", "randomYawVelocity", "+=", "d11", "*", "(", "0.69999998807907104D", "/", "d14", "/", "(", "double", ")", "f19", ")", ";", "rotationYaw", "+=", "randomYawVelocity", "*", "0.1F", ";", "float", "f20", "=", "(", "float", ")", "(", "2D", "/", "(", "d14", "+", "1.0D", ")", ")", ";", "float", "f21", "=", "0.06F", ";", "moveFlying", "(", "0.0F", ",", "-", "1F", ",", "f21", "*", "(", "f18", "*", "f20", "+", "(", "1.0F", "-", "f20", ")", ")", ")", ";", "if", "(", "field_40159_q", ")", "{", "moveEntity", "(", "motionX", "*", "0.80000001192092896D", ",", "motionY", "*", "0.80000001192092896D", ",", "motionZ", "*", "0.80000001192092896D", ")", ";", "}", "else", "{", "moveEntity", "(", "motionX", ",", "motionY", ",", "motionZ", ")", ";", "}", "Vec3D", "vec3d2", "=", "Vec3D", ".", "createVector", "(", "motionX", ",", "motionY", ",", "motionZ", ")", ".", "normalize", "(", ")", ";", "float", "f22", "=", "(", "float", ")", "(", "vec3d2", ".", "dotProduct", "(", "vec3d1", ")", "+", "1.0D", ")", "/", "2.0F", ";", "f22", "=", "0.8F", "+", "0.15F", "*", "f22", ";", "motionX", "*=", "f22", ";", "motionZ", "*=", "f22", ";", "motionY", "*=", "0.9100000262260437D", ";", "}", "renderYawOffset", "=", "rotationYaw", ";", "dragonPartHead", ".", "width", "=", "dragonPartHead", ".", "height", "=", "3F", ";", "dragonPartTail1", ".", "width", "=", "dragonPartTail1", ".", "height", "=", "2.0F", ";", "dragonPartTail2", ".", "width", "=", "dragonPartTail2", ".", "height", "=", "2.0F", ";", "dragonPartTail3", ".", "width", "=", "dragonPartTail3", ".", "height", "=", "2.0F", ";", "dragonPartBody", ".", "height", "=", "3F", ";", "dragonPartBody", ".", "width", "=", "5F", ";", "dragonPartWing1", ".", "height", "=", "2.0F", ";", "dragonPartWing1", ".", "width", "=", "4F", ";", "dragonPartWing2", ".", "height", "=", "3F", ";", "dragonPartWing2", ".", "width", "=", "4F", ";", "float", "f3", "=", "(", "(", "(", "float", ")", "(", "func_40139_a", "(", "5", ",", "1.0F", ")", "[", "1", "]", "-", "func_40139_a", "(", "10", ",", "1.0F", ")", "[", "1", "]", ")", "*", "10F", ")", "/", "180F", ")", "*", "(", "float", ")", "Math", ".", "PI", ";", "float", "f5", "=", "MathHelper", ".", "cos", "(", "f3", ")", ";", "float", "f6", "=", "-", "MathHelper", ".", "sin", "(", "f3", ")", ";", "float", "f7", "=", "(", "rotationYaw", "*", "(", "float", ")", "Math", ".", "PI", ")", "/", "180F", ";", "float", "f8", "=", "MathHelper", ".", "sin", "(", "f7", ")", ";", "float", "f9", "=", "MathHelper", ".", "cos", "(", "f7", ")", ";", "dragonPartBody", ".", "onUpdate", "(", ")", ";", "dragonPartBody", ".", "setLocationAndAngles", "(", "posX", "+", "(", "double", ")", "(", "f8", "*", "0.5F", ")", ",", "posY", ",", "posZ", "-", "(", "double", ")", "(", "f9", "*", "0.5F", ")", ",", "0.0F", ",", "0.0F", ")", ";", "dragonPartWing1", ".", "onUpdate", "(", ")", ";", "dragonPartWing1", ".", "setLocationAndAngles", "(", "posX", "+", "(", "double", ")", "(", "f9", "*", "4.5F", ")", ",", "posY", "+", "2D", ",", "posZ", "+", "(", "double", ")", "(", "f8", "*", "4.5F", ")", ",", "0.0F", ",", "0.0F", ")", ";", "dragonPartWing2", ".", "onUpdate", "(", ")", ";", "dragonPartWing2", ".", "setLocationAndAngles", "(", "posX", "-", "(", "double", ")", "(", "f9", "*", "4.5F", ")", ",", "posY", "+", "2D", ",", "posZ", "-", "(", "double", ")", "(", "f8", "*", "4.5F", ")", ",", "0.0F", ",", "0.0F", ")", ";", "if", "(", "!", "worldObj", ".", "isRemote", ")", "{", "func_41033_v", "(", ")", ";", "}", "if", "(", "!", "worldObj", ".", "isRemote", "&&", "maxHurtTime", "==", "0", ")", "{", "collideWithEntities", "(", "worldObj", ".", "getEntitiesWithinAABBExcludingEntity", "(", "this", ",", "dragonPartWing1", ".", "boundingBox", ".", "expand", "(", "4D", ",", "2D", ",", "4D", ")", ".", "offset", "(", "0.0D", ",", "-", "2D", ",", "0.0D", ")", ")", ")", ";", "collideWithEntities", "(", "worldObj", ".", "getEntitiesWithinAABBExcludingEntity", "(", "this", ",", "dragonPartWing2", ".", "boundingBox", ".", "expand", "(", "4D", ",", "2D", ",", "4D", ")", ".", "offset", "(", "0.0D", ",", "-", "2D", ",", "0.0D", ")", ")", ")", ";", "attackEntitiesInList", "(", "worldObj", ".", "getEntitiesWithinAABBExcludingEntity", "(", "this", ",", "dragonPartHead", ".", "boundingBox", ".", "expand", "(", "1.0D", ",", "1.0D", ",", "1.0D", ")", ")", ")", ";", "}", "double", "ad", "[", "]", "=", "func_40139_a", "(", "5", ",", "1.0F", ")", ";", "double", "ad1", "[", "]", "=", "func_40139_a", "(", "0", ",", "1.0F", ")", ";", "float", "f11", "=", "MathHelper", ".", "sin", "(", "(", "rotationYaw", "*", "(", "float", ")", "Math", ".", "PI", ")", "/", "180F", "-", "randomYawVelocity", "*", "0.01F", ")", ";", "float", "f12", "=", "MathHelper", ".", "cos", "(", "(", "rotationYaw", "*", "(", "float", ")", "Math", ".", "PI", ")", "/", "180F", "-", "randomYawVelocity", "*", "0.01F", ")", ";", "dragonPartHead", ".", "onUpdate", "(", ")", ";", "dragonPartHead", ".", "setLocationAndAngles", "(", "posX", "+", "(", "double", ")", "(", "f11", "*", "5.5F", "*", "f5", ")", ",", "posY", "+", "(", "ad1", "[", "1", "]", "-", "ad", "[", "1", "]", ")", "*", "1.0D", "+", "(", "double", ")", "(", "f6", "*", "5.5F", ")", ",", "posZ", "-", "(", "double", ")", "(", "f12", "*", "5.5F", "*", "f5", ")", ",", "0.0F", ",", "0.0F", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "3", ";", "j", "++", ")", "{", "EntityDragonPart", "entitydragonpart", "=", "null", ";", "if", "(", "j", "==", "0", ")", "{", "entitydragonpart", "=", "dragonPartTail1", ";", "}", "if", "(", "j", "==", "1", ")", "{", "entitydragonpart", "=", "dragonPartTail2", ";", "}", "if", "(", "j", "==", "2", ")", "{", "entitydragonpart", "=", "dragonPartTail3", ";", "}", "double", "ad2", "[", "]", "=", "func_40139_a", "(", "12", "+", "j", "*", "2", ",", "1.0F", ")", ";", "float", "f13", "=", "(", "rotationYaw", "*", "(", "float", ")", "Math", ".", "PI", ")", "/", "180F", "+", "(", "(", "simplifyAngle", "(", "ad2", "[", "0", "]", "-", "ad", "[", "0", "]", ")", "*", "(", "float", ")", "Math", ".", "PI", ")", "/", "180F", ")", "*", "1.0F", ";", "float", "f14", "=", "MathHelper", ".", "sin", "(", "f13", ")", ";", "float", "f15", "=", "MathHelper", ".", "cos", "(", "f13", ")", ";", "float", "f16", "=", "1.5F", ";", "float", "f17", "=", "(", "float", ")", "(", "j", "+", "1", ")", "*", "2.0F", ";", "entitydragonpart", ".", "onUpdate", "(", ")", ";", "entitydragonpart", ".", "setLocationAndAngles", "(", "posX", "-", "(", "double", ")", "(", "(", "f8", "*", "f16", "+", "f14", "*", "f17", ")", "*", "f5", ")", ",", "(", "(", "posY", "+", "(", "ad2", "[", "1", "]", "-", "ad", "[", "1", "]", ")", "*", "1.0D", ")", "-", "(", "double", ")", "(", "(", "f17", "+", "f16", ")", "*", "f6", ")", ")", "+", "1.5D", ",", "posZ", "+", "(", "double", ")", "(", "(", "f9", "*", "f16", "+", "f15", "*", "f17", ")", "*", "f5", ")", ",", "0.0F", ",", "0.0F", ")", ";", "}", "if", "(", "!", "worldObj", ".", "isRemote", ")", "{", "field_40159_q", "=", "destroyBlocksInAABB", "(", "dragonPartHead", ".", "boundingBox", ")", "|", "destroyBlocksInAABB", "(", "dragonPartBody", ".", "boundingBox", ")", ";", "}", "}", "private", "void", "updateDragonEnderCrystal", "(", ")", "{", "if", "(", "healingEnderCrystal", "!=", "null", ")", "{", "if", "(", "healingEnderCrystal", ".", "isDead", ")", "{", "if", "(", "!", "worldObj", ".", "isRemote", ")", "{", "attackEntityFromPart", "(", "dragonPartHead", ",", "DamageSource", ".", "explosion", ",", "10", ")", ";", "}", "healingEnderCrystal", "=", "null", ";", "}", "else", "if", "(", "ticksExisted", "%", "10", "==", "0", "&&", "health", "<", "maxHealth", ")", "{", "health", "++", ";", "}", "}", "if", "(", "rand", ".", "nextInt", "(", "10", ")", "==", "0", ")", "{", "float", "f", "=", "32F", ";", "List", "list", "=", "worldObj", ".", "getEntitiesWithinAABB", "(", "net", ".", "minecraft", ".", "src", ".", "EntityEnderCrystal", ".", "class", ",", "boundingBox", ".", "expand", "(", "f", ",", "f", ",", "f", ")", ")", ";", "EntityEnderCrystal", "entityendercrystal", "=", "null", ";", "double", "d", "=", "Double", ".", "MAX_VALUE", ";", "Iterator", "iterator", "=", "list", ".", "iterator", "(", ")", ";", "do", "{", "if", "(", "!", "iterator", ".", "hasNext", "(", ")", ")", "{", "break", ";", "}", "Entity", "entity", "=", "(", "Entity", ")", "iterator", ".", "next", "(", ")", ";", "double", "d1", "=", "entity", ".", "getDistanceSqToEntity", "(", "this", ")", ";", "if", "(", "d1", "<", "d", ")", "{", "d", "=", "d1", ";", "entityendercrystal", "=", "(", "EntityEnderCrystal", ")", "entity", ";", "}", "}", "while", "(", "true", ")", ";", "healingEnderCrystal", "=", "entityendercrystal", ";", "}", "}", "private", "void", "func_41033_v", "(", ")", "{", "}", "private", "void", "collideWithEntities", "(", "List", "par1List", ")", "{", "double", "d", "=", "(", "dragonPartBody", ".", "boundingBox", ".", "minX", "+", "dragonPartBody", ".", "boundingBox", ".", "maxX", ")", "/", "2D", ";", "double", "d1", "=", "(", "dragonPartBody", ".", "boundingBox", ".", "minZ", "+", "dragonPartBody", ".", "boundingBox", ".", "maxZ", ")", "/", "2D", ";", "Iterator", "iterator", "=", "par1List", ".", "iterator", "(", ")", ";", "do", "{", "if", "(", "!", "iterator", ".", "hasNext", "(", ")", ")", "{", "break", ";", "}", "Entity", "entity", "=", "(", "Entity", ")", "iterator", ".", "next", "(", ")", ";", "if", "(", "entity", "instanceof", "EntityLiving", ")", "{", "double", "d2", "=", "entity", ".", "posX", "-", "d", ";", "double", "d3", "=", "entity", ".", "posZ", "-", "d1", ";", "double", "d4", "=", "d2", "*", "d2", "+", "d3", "*", "d3", ";", "entity", ".", "addVelocity", "(", "(", "d2", "/", "d4", ")", "*", "4D", ",", "0.20000000298023224D", ",", "(", "d3", "/", "d4", ")", "*", "4D", ")", ";", "}", "}", "while", "(", "true", ")", ";", "}", "private", "void", "attackEntitiesInList", "(", "List", "par1List", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "par1List", ".", "size", "(", ")", ";", "i", "++", ")", "{", "Entity", "entity", "=", "(", "Entity", ")", "par1List", ".", "get", "(", "i", ")", ";", "if", "(", "entity", "instanceof", "EntityLiving", ")", "{", "entity", ".", "attackEntityFrom", "(", "DamageSource", ".", "causeMobDamage", "(", "this", ")", ",", "10", ")", ";", "}", "}", "}", "private", "void", "func_41037_w", "(", ")", "{", "field_40160_p", "=", "false", ";", "if", "(", "rand", ".", "nextInt", "(", "2", ")", "==", "0", "&&", "worldObj", ".", "playerEntities", ".", "size", "(", ")", ">", "0", ")", "{", "target", "=", "(", "Entity", ")", "worldObj", ".", "playerEntities", ".", "get", "(", "rand", ".", "nextInt", "(", "worldObj", ".", "playerEntities", ".", "size", "(", ")", ")", ")", ";", "}", "else", "{", "boolean", "flag", "=", "false", ";", "do", "{", "targetX", "=", "0.0D", ";", "targetY", "=", "70F", "+", "rand", ".", "nextFloat", "(", ")", "*", "50F", ";", "targetZ", "=", "0.0D", ";", "targetX", "+=", "rand", ".", "nextFloat", "(", ")", "*", "120F", "-", "60F", ";", "targetZ", "+=", "rand", ".", "nextFloat", "(", ")", "*", "120F", "-", "60F", ";", "double", "d", "=", "posX", "-", "targetX", ";", "double", "d1", "=", "posY", "-", "targetY", ";", "double", "d2", "=", "posZ", "-", "targetZ", ";", "flag", "=", "d", "*", "d", "+", "d1", "*", "d1", "+", "d2", "*", "d2", ">", "100D", ";", "}", "while", "(", "!", "flag", ")", ";", "target", "=", "null", ";", "}", "}", "private", "float", "simplifyAngle", "(", "double", "par1", ")", "{", "for", "(", ";", "par1", ">=", "180D", ";", "par1", "-=", "360D", ")", "{", "}", "for", "(", ";", "par1", "<", "-", "180D", ";", "par1", "+=", "360D", ")", "{", "}", "return", "(", "float", ")", "par1", ";", "}", "private", "boolean", "destroyBlocksInAABB", "(", "AxisAlignedBB", "par1AxisAlignedBB", ")", "{", "int", "i", "=", "MathHelper", ".", "floor_double", "(", "par1AxisAlignedBB", ".", "minX", ")", ";", "int", "j", "=", "MathHelper", ".", "floor_double", "(", "par1AxisAlignedBB", ".", "minY", ")", ";", "int", "k", "=", "MathHelper", ".", "floor_double", "(", "par1AxisAlignedBB", ".", "minZ", ")", ";", "int", "l", "=", "MathHelper", ".", "floor_double", "(", "par1AxisAlignedBB", ".", "maxX", ")", ";", "int", "i1", "=", "MathHelper", ".", "floor_double", "(", "par1AxisAlignedBB", ".", "maxY", ")", ";", "int", "j1", "=", "MathHelper", ".", "floor_double", "(", "par1AxisAlignedBB", ".", "maxZ", ")", ";", "boolean", "flag", "=", "false", ";", "boolean", "flag1", "=", "false", ";", "for", "(", "int", "k1", "=", "i", ";", "k1", "<=", "l", ";", "k1", "++", ")", "{", "for", "(", "int", "l1", "=", "j", ";", "l1", "<=", "i1", ";", "l1", "++", ")", "{", "for", "(", "int", "i2", "=", "k", ";", "i2", "<=", "j1", ";", "i2", "++", ")", "{", "int", "j2", "=", "worldObj", ".", "getBlockId", "(", "k1", ",", "l1", ",", "i2", ")", ";", "if", "(", "j2", "==", "0", ")", "{", "continue", ";", "}", "if", "(", "j2", "==", "Block", ".", "obsidian", ".", "blockID", "||", "j2", "==", "Block", ".", "whiteStone", ".", "blockID", "||", "j2", "==", "Block", ".", "bedrock", ".", "blockID", ")", "{", "flag", "=", "true", ";", "}", "else", "{", "flag1", "=", "true", ";", "worldObj", ".", "setBlockWithNotify", "(", "k1", ",", "l1", ",", "i2", ",", "0", ")", ";", "}", "}", "}", "}", "if", "(", "flag1", ")", "{", "double", "d", "=", "par1AxisAlignedBB", ".", "minX", "+", "(", "par1AxisAlignedBB", ".", "maxX", "-", "par1AxisAlignedBB", ".", "minX", ")", "*", "(", "double", ")", "rand", ".", "nextFloat", "(", ")", ";", "double", "d1", "=", "par1AxisAlignedBB", ".", "minY", "+", "(", "par1AxisAlignedBB", ".", "maxY", "-", "par1AxisAlignedBB", ".", "minY", ")", "*", "(", "double", ")", "rand", ".", "nextFloat", "(", ")", ";", "double", "d2", "=", "par1AxisAlignedBB", ".", "minZ", "+", "(", "par1AxisAlignedBB", ".", "maxZ", "-", "par1AxisAlignedBB", ".", "minZ", ")", "*", "(", "double", ")", "rand", ".", "nextFloat", "(", ")", ";", "worldObj", ".", "spawnParticle", "(", "\"largeexplode\"", ",", "d", ",", "d1", ",", "d2", ",", "0.0D", ",", "0.0D", ",", "0.0D", ")", ";", "}", "return", "flag", ";", "}", "public", "boolean", "attackEntityFromPart", "(", "EntityDragonPart", "par1EntityDragonPart", ",", "DamageSource", "par2DamageSource", ",", "int", "par3", ")", "{", "if", "(", "par1EntityDragonPart", "!=", "dragonPartHead", ")", "{", "par3", "=", "par3", "/", "4", "+", "1", ";", "}", "float", "f", "=", "(", "rotationYaw", "*", "(", "float", ")", "Math", ".", "PI", ")", "/", "180F", ";", "float", "f1", "=", "MathHelper", ".", "sin", "(", "f", ")", ";", "float", "f2", "=", "MathHelper", ".", "cos", "(", "f", ")", ";", "targetX", "=", "posX", "+", "(", "double", ")", "(", "f1", "*", "5F", ")", "+", "(", "double", ")", "(", "(", "rand", ".", "nextFloat", "(", ")", "-", "0.5F", ")", "*", "2.0F", ")", ";", "targetY", "=", "posY", "+", "(", "double", ")", "(", "rand", ".", "nextFloat", "(", ")", "*", "3F", ")", "+", "1.0D", ";", "targetZ", "=", "(", "posZ", "-", "(", "double", ")", "(", "f2", "*", "5F", ")", ")", "+", "(", "double", ")", "(", "(", "rand", ".", "nextFloat", "(", ")", "-", "0.5F", ")", "*", "2.0F", ")", ";", "target", "=", "null", ";", "if", "(", "(", "par2DamageSource", ".", "getEntity", "(", ")", "instanceof", "EntityPlayer", ")", "||", "par2DamageSource", "==", "DamageSource", ".", "explosion", ")", "{", "superAttackFrom", "(", "par2DamageSource", ",", "par3", ")", ";", "}", "return", "true", ";", "}", "protected", "void", "onDeathUpdate", "(", ")", "{", "field_40158_r", "++", ";", "if", "(", "field_40158_r", ">=", "180", "&&", "field_40158_r", "<=", "200", ")", "{", "float", "f", "=", "(", "rand", ".", "nextFloat", "(", ")", "-", "0.5F", ")", "*", "8F", ";", "float", "f1", "=", "(", "rand", ".", "nextFloat", "(", ")", "-", "0.5F", ")", "*", "4F", ";", "float", "f2", "=", "(", "rand", ".", "nextFloat", "(", ")", "-", "0.5F", ")", "*", "8F", ";", "worldObj", ".", "spawnParticle", "(", "\"\"", ",", "posX", "+", "(", "double", ")", "f", ",", "posY", "+", "2D", "+", "(", "double", ")", "f1", ",", "posZ", "+", "(", "double", ")", "f2", ",", "0.0D", ",", "0.0D", ",", "0.0D", ")", ";", "}", "if", "(", "!", "worldObj", ".", "isRemote", "&&", "field_40158_r", ">", "150", "&&", "field_40158_r", "%", "5", "==", "0", ")", "{", "for", "(", "int", "i", "=", "1000", ";", "i", ">", "0", ";", ")", "{", "int", "k", "=", "EntityXPOrb", ".", "getXPSplit", "(", "i", ")", ";", "i", "-=", "k", ";", "worldObj", ".", "spawnEntityInWorld", "(", "new", "EntityXPOrb", "(", "worldObj", ",", "posX", ",", "posY", ",", "posZ", ",", "k", ")", ")", ";", "}", "}", "moveEntity", "(", "0.0D", ",", "0.10000000149011612D", ",", "0.0D", ")", ";", "renderYawOffset", "=", "rotationYaw", "+=", "20F", ";", "if", "(", "field_40158_r", "==", "200", ")", "{", "for", "(", "int", "j", "=", "10000", ";", "j", ">", "0", ";", ")", "{", "int", "l", "=", "EntityXPOrb", ".", "getXPSplit", "(", "j", ")", ";", "j", "-=", "l", ";", "worldObj", ".", "spawnEntityInWorld", "(", "new", "EntityXPOrb", "(", "worldObj", ",", "posX", ",", "posY", ",", "posZ", ",", "l", ")", ")", ";", "}", "createEnderPortal", "(", "MathHelper", ".", "floor_double", "(", "posX", ")", ",", "MathHelper", ".", "floor_double", "(", "posZ", ")", ")", ";", "onEntityDeath", "(", ")", ";", "setDead", "(", ")", ";", "}", "}", "private", "void", "createEnderPortal", "(", "int", "par1", ",", "int", "par2", ")", "{", "byte", "byte0", "=", "64", ";", "BlockEndPortal", ".", "bossDefeated", "=", "true", ";", "int", "i", "=", "4", ";", "for", "(", "int", "j", "=", "byte0", "-", "1", ";", "j", "<=", "byte0", "+", "32", ";", "j", "++", ")", "{", "for", "(", "int", "k", "=", "par1", "-", "i", ";", "k", "<=", "par1", "+", "i", ";", "k", "++", ")", "{", "for", "(", "int", "l", "=", "par2", "-", "i", ";", "l", "<=", "par2", "+", "i", ";", "l", "++", ")", "{", "double", "d", "=", "k", "-", "par1", ";", "double", "d1", "=", "l", "-", "par2", ";", "double", "d2", "=", "MathHelper", ".", "sqrt_double", "(", "d", "*", "d", "+", "d1", "*", "d1", ")", ";", "if", "(", "d2", ">", "(", "double", ")", "i", "-", "0.5D", ")", "{", "continue", ";", "}", "if", "(", "j", "<", "byte0", ")", "{", "if", "(", "d2", "<=", "(", "double", ")", "(", "i", "-", "1", ")", "-", "0.5D", ")", "{", "worldObj", ".", "setBlockWithNotify", "(", "k", ",", "j", ",", "l", ",", "Block", ".", "bedrock", ".", "blockID", ")", ";", "}", "continue", ";", "}", "if", "(", "j", ">", "byte0", ")", "{", "worldObj", ".", "setBlockWithNotify", "(", "k", ",", "j", ",", "l", ",", "0", ")", ";", "continue", ";", "}", "if", "(", "d2", ">", "(", "double", ")", "(", "i", "-", "1", ")", "-", "0.5D", ")", "{", "worldObj", ".", "setBlockWithNotify", "(", "k", ",", "j", ",", "l", ",", "Block", ".", "bedrock", ".", "blockID", ")", ";", "}", "else", "{", "worldObj", ".", "setBlockWithNotify", "(", "k", ",", "j", ",", "l", ",", "Block", ".", "endPortal", ".", "blockID", ")", ";", "}", "}", "}", "}", "worldObj", ".", "setBlockWithNotify", "(", "par1", ",", "byte0", "+", "0", ",", "par2", ",", "Block", ".", "bedrock", ".", "blockID", ")", ";", "worldObj", ".", "setBlockWithNotify", "(", "par1", ",", "byte0", "+", "1", ",", "par2", ",", "Block", ".", "bedrock", ".", "blockID", ")", ";", "worldObj", ".", "setBlockWithNotify", "(", "par1", ",", "byte0", "+", "2", ",", "par2", ",", "Block", ".", "bedrock", ".", "blockID", ")", ";", "worldObj", ".", "setBlockWithNotify", "(", "par1", "-", "1", ",", "byte0", "+", "2", ",", "par2", ",", "Block", ".", "torchWood", ".", "blockID", ")", ";", "worldObj", ".", "setBlockWithNotify", "(", "par1", "+", "1", ",", "byte0", "+", "2", ",", "par2", ",", "Block", ".", "torchWood", ".", "blockID", ")", ";", "worldObj", ".", "setBlockWithNotify", "(", "par1", ",", "byte0", "+", "2", ",", "par2", "-", "1", ",", "Block", ".", "torchWood", ".", "blockID", ")", ";", "worldObj", ".", "setBlockWithNotify", "(", "par1", ",", "byte0", "+", "2", ",", "par2", "+", "1", ",", "Block", ".", "torchWood", ".", "blockID", ")", ";", "worldObj", ".", "setBlockWithNotify", "(", "par1", ",", "byte0", "+", "3", ",", "par2", ",", "Block", ".", "bedrock", ".", "blockID", ")", ";", "worldObj", ".", "setBlockWithNotify", "(", "par1", ",", "byte0", "+", "4", ",", "par2", ",", "Block", ".", "dragonEgg", ".", "blockID", ")", ";", "BlockEndPortal", ".", "bossDefeated", "=", "false", ";", "}", "protected", "void", "despawnEntity", "(", ")", "{", "}", "public", "Entity", "[", "]", "getParts", "(", ")", "{", "return", "dragonPartArray", ";", "}", "public", "boolean", "canBeCollidedWith", "(", ")", "{", "return", "false", ";", "}", "}", "</s>" ]
9,952
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "final", "class", "EnchantmentModifierDamage", "implements", "IEnchantmentModifier", "{", "public", "int", "damageModifier", ";", "public", "DamageSource", "damageSource", ";", "private", "EnchantmentModifierDamage", "(", ")", "{", "}", "public", "void", "calculateModifier", "(", "Enchantment", "par1Enchantment", ",", "int", "par2", ")", "{", "damageModifier", "+=", "par1Enchantment", ".", "calcModifierDamage", "(", "par2", ",", "damageSource", ")", ";", "}", "EnchantmentModifierDamage", "(", "Empty3", "par1Empty3", ")", "{", "this", "(", ")", ";", "}", "}", "</s>" ]
9,953
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "MapColor", "{", "public", "static", "final", "MapColor", "mapColorArray", "[", "]", "=", "new", "MapColor", "[", "16", "]", ";", "public", "static", "final", "MapColor", "airColor", "=", "new", "MapColor", "(", "0", ",", "0", ")", ";", "public", "static", "final", "MapColor", "grassColor", "=", "new", "MapColor", "(", "1", ",", "0x7fb238", ")", ";", "public", "static", "final", "MapColor", "sandColor", "=", "new", "MapColor", "(", "2", ",", "0xf7e9a3", ")", ";", "public", "static", "final", "MapColor", "clothColor", "=", "new", "MapColor", "(", "3", ",", "0xa7a7a7", ")", ";", "public", "static", "final", "MapColor", "tntColor", "=", "new", "MapColor", "(", "4", ",", "0xff0000", ")", ";", "public", "static", "final", "MapColor", "iceColor", "=", "new", "MapColor", "(", "5", ",", "0xa0a0ff", ")", ";", "public", "static", "final", "MapColor", "ironColor", "=", "new", "MapColor", "(", "6", ",", "0xa7a7a7", ")", ";", "public", "static", "final", "MapColor", "foliageColor", "=", "new", "MapColor", "(", "7", ",", "31744", ")", ";", "public", "static", "final", "MapColor", "snowColor", "=", "new", "MapColor", "(", "8", ",", "0xffffff", ")", ";", "public", "static", "final", "MapColor", "clayColor", "=", "new", "MapColor", "(", "9", ",", "0xa4a8b8", ")", ";", "public", "static", "final", "MapColor", "dirtColor", "=", "new", "MapColor", "(", "10", ",", "0xb76a2f", ")", ";", "public", "static", "final", "MapColor", "stoneColor", "=", "new", "MapColor", "(", "11", ",", "0x707070", ")", ";", "public", "static", "final", "MapColor", "waterColor", "=", "new", "MapColor", "(", "12", ",", "0x4040ff", ")", ";", "public", "static", "final", "MapColor", "woodColor", "=", "new", "MapColor", "(", "13", ",", "0x685332", ")", ";", "public", "final", "int", "colorValue", ";", "public", "final", "int", "colorIndex", ";", "private", "MapColor", "(", "int", "par1", ",", "int", "par2", ")", "{", "colorIndex", "=", "par1", ";", "colorValue", "=", "par2", ";", "mapColorArray", "[", "par1", "]", "=", "this", ";", "}", "}", "</s>" ]
9,954
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "WorldProviderHell", "extends", "WorldProvider", "{", "public", "WorldProviderHell", "(", ")", "{", "}", "public", "void", "registerWorldChunkManager", "(", ")", "{", "worldChunkMgr", "=", "new", "WorldChunkManagerHell", "(", "BiomeGenBase", ".", "hell", ",", "1.0F", ",", "0.0F", ")", ";", "isHellWorld", "=", "true", ";", "hasNoSky", "=", "true", ";", "worldType", "=", "-", "1", ";", "}", "protected", "void", "generateLightBrightnessTable", "(", ")", "{", "float", "f", "=", "0.1F", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<=", "15", ";", "i", "++", ")", "{", "float", "f1", "=", "1.0F", "-", "(", "float", ")", "i", "/", "15F", ";", "lightBrightnessTable", "[", "i", "]", "=", "(", "(", "1.0F", "-", "f1", ")", "/", "(", "f1", "*", "3F", "+", "1.0F", ")", ")", "*", "(", "1.0F", "-", "f", ")", "+", "f", ";", "}", "}", "public", "IChunkProvider", "getChunkProvider", "(", ")", "{", "return", "new", "ChunkProviderHell", "(", "worldObj", ",", "worldObj", ".", "getSeed", "(", ")", ")", ";", "}", "public", "boolean", "func_48567_d", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "canCoordinateBeSpawn", "(", "int", "par1", ",", "int", "par2", ")", "{", "return", "false", ";", "}", "public", "float", "calculateCelestialAngle", "(", "long", "par1", ",", "float", "par3", ")", "{", "return", "0.5F", ";", "}", "public", "boolean", "canRespawnHere", "(", ")", "{", "return", "false", ";", "}", "}", "</s>" ]
9,955
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "ItemSapling", "extends", "ItemBlock", "{", "public", "ItemSapling", "(", "int", "par1", ")", "{", "super", "(", "par1", ")", ";", "setMaxDamage", "(", "0", ")", ";", "setHasSubtypes", "(", "true", ")", ";", "}", "public", "int", "getMetadata", "(", "int", "par1", ")", "{", "return", "par1", ";", "}", "}", "</s>" ]
9,956
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "EntityDamageSourceIndirect", "extends", "EntityDamageSource", "{", "private", "Entity", "indirectEntity", ";", "public", "EntityDamageSourceIndirect", "(", "String", "par1Str", ",", "Entity", "par2Entity", ",", "Entity", "par3Entity", ")", "{", "super", "(", "par1Str", ",", "par2Entity", ")", ";", "indirectEntity", "=", "par3Entity", ";", "}", "public", "Entity", "getSourceOfDamage", "(", ")", "{", "return", "damageSourceEntity", ";", "}", "public", "Entity", "getEntity", "(", ")", "{", "return", "indirectEntity", ";", "}", "public", "String", "getDeathMessage", "(", "EntityPlayer", "par1EntityPlayer", ")", "{", "return", "StatCollector", ".", "translateToLocalFormatted", "(", "(", "new", "StringBuilder", "(", ")", ")", ".", "append", "(", "\"death.\"", ")", ".", "append", "(", "damageType", ")", ".", "toString", "(", ")", ",", "new", "Object", "[", "]", "{", "par1EntityPlayer", ".", "username", ",", "indirectEntity", ".", "getUsername", "(", ")", "}", ")", ";", "}", "}", "</s>" ]
9,957
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "logging", ".", "*", ";", "public", "class", "ConsoleLogManager", "{", "public", "static", "Logger", "logger", "=", "Logger", ".", "getLogger", "(", "\"Minecraft\"", ")", ";", "public", "ConsoleLogManager", "(", ")", "{", "}", "public", "static", "void", "init", "(", ")", "{", "ConsoleLogFormatter", "consolelogformatter", "=", "new", "ConsoleLogFormatter", "(", ")", ";", "logger", ".", "setUseParentHandlers", "(", "false", ")", ";", "ConsoleHandler", "consolehandler", "=", "new", "ConsoleHandler", "(", ")", ";", "consolehandler", ".", "setFormatter", "(", "consolelogformatter", ")", ";", "logger", ".", "addHandler", "(", "consolehandler", ")", ";", "try", "{", "FileHandler", "filehandler", "=", "new", "FileHandler", "(", "\"server.log\"", ",", "true", ")", ";", "filehandler", ".", "setFormatter", "(", "consolelogformatter", ")", ";", "logger", ".", "addHandler", "(", "filehandler", ")", ";", "}", "catch", "(", "Exception", "exception", ")", "{", "logger", ".", "log", "(", "Level", ".", "WARNING", ",", "\"\"", ",", "exception", ")", ";", "}", "}", "}", "</s>" ]
9,958
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "io", ".", "*", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "AnvilChunkLoader", "implements", "IChunkLoader", ",", "IThreadedFileIO", "{", "private", "List", "field_48469_a", ";", "private", "Set", "field_48467_b", ";", "private", "Object", "field_48468_c", ";", "private", "final", "File", "chunkSaveLocation", ";", "public", "AnvilChunkLoader", "(", "File", "par1File", ")", "{", "field_48469_a", "=", "new", "ArrayList", "(", ")", ";", "field_48467_b", "=", "new", "HashSet", "(", ")", ";", "field_48468_c", "=", "new", "Object", "(", ")", ";", "chunkSaveLocation", "=", "par1File", ";", "}", "public", "Chunk", "loadChunk", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ")", "throws", "IOException", "{", "NBTTagCompound", "nbttagcompound", "=", "null", ";", "ChunkCoordIntPair", "chunkcoordintpair", "=", "new", "ChunkCoordIntPair", "(", "par2", ",", "par3", ")", ";", "synchronized", "(", "field_48468_c", ")", "{", "if", "(", "field_48467_b", ".", "contains", "(", "chunkcoordintpair", ")", ")", "{", "int", "i", "=", "0", ";", "do", "{", "if", "(", "i", ">=", "field_48469_a", ".", "size", "(", ")", ")", "{", "break", ";", "}", "if", "(", "(", "(", "AnvilChunkLoaderPending", ")", "field_48469_a", ".", "get", "(", "i", ")", ")", ".", "field_48581_a", ".", "equals", "(", "chunkcoordintpair", ")", ")", "{", "nbttagcompound", "=", "(", "(", "AnvilChunkLoaderPending", ")", "field_48469_a", ".", "get", "(", "i", ")", ")", ".", "field_48580_b", ";", "break", ";", "}", "i", "++", ";", "}", "while", "(", "true", ")", ";", "}", "}", "if", "(", "nbttagcompound", "==", "null", ")", "{", "java", ".", "io", ".", "DataInputStream", "datainputstream", "=", "RegionFileCache", ".", "getChunkInputStream", "(", "chunkSaveLocation", ",", "par2", ",", "par3", ")", ";", "if", "(", "datainputstream", "!=", "null", ")", "{", "nbttagcompound", "=", "CompressedStreamTools", ".", "read", "(", "datainputstream", ")", ";", "}", "else", "{", "return", "null", ";", "}", "}", "return", "func_48464_a", "(", "par1World", ",", "par2", ",", "par3", ",", "nbttagcompound", ")", ";", "}", "protected", "Chunk", "func_48464_a", "(", "World", "par1World", ",", "int", "par2", ",", "int", "par3", ",", "NBTTagCompound", "par4NBTTagCompound", ")", "{", "if", "(", "!", "par4NBTTagCompound", ".", "hasKey", "(", "\"Level\"", ")", ")", "{", "System", ".", "out", ".", "println", "(", "(", "new", "StringBuilder", "(", ")", ")", ".", "append", "(", "\"\"", ")", ".", "append", "(", "par2", ")", ".", "append", "(", "\",\"", ")", ".", "append", "(", "par3", ")", ".", "append", "(", "\"\"", ")", ".", "toString", "(", ")", ")", ";", "return", "null", ";", "}", "if", "(", "!", "par4NBTTagCompound", ".", "getCompoundTag", "(", "\"Level\"", ")", ".", "hasKey", "(", "\"Sections\"", ")", ")", "{", "System", ".", "out", ".", "println", "(", "(", "new", "StringBuilder", "(", ")", ")", ".", "append", "(", "\"\"", ")", ".", "append", "(", "par2", ")", ".", "append", "(", "\",\"", ")", ".", "append", "(", "par3", ")", ".", "append", "(", "\"\"", ")", ".", "toString", "(", ")", ")", ";", "return", "null", ";", "}", "Chunk", "chunk", "=", "func_48465_a", "(", "par1World", ",", "par4NBTTagCompound", ".", "getCompoundTag", "(", "\"Level\"", ")", ")", ";", "if", "(", "!", "chunk", ".", "isAtLocation", "(", "par2", ",", "par3", ")", ")", "{", "System", ".", "out", ".", "println", "(", "(", "new", "StringBuilder", "(", ")", ")", ".", "append", "(", "\"\"", ")", ".", "append", "(", "par2", ")", ".", "append", "(", "\",\"", ")", ".", "append", "(", "par3", ")", ".", "append", "(", "\"\"", ")", ".", "append", "(", "par2", ")", ".", "append", "(", "\",", "\"", ")", ".", "append", "(", "par3", ")", ".", "append", "(", "\",", "got", "\"", ")", ".", "append", "(", "chunk", ".", "xPosition", ")", ".", "append", "(", "\",", "\"", ")", ".", "append", "(", "chunk", ".", "zPosition", ")", ".", "append", "(", "\")\"", ")", ".", "toString", "(", ")", ")", ";", "par4NBTTagCompound", ".", "setInteger", "(", "\"xPos\"", ",", "par2", ")", ";", "par4NBTTagCompound", ".", "setInteger", "(", "\"zPos\"", ",", "par3", ")", ";", "chunk", "=", "func_48465_a", "(", "par1World", ",", "par4NBTTagCompound", ".", "getCompoundTag", "(", "\"Level\"", ")", ")", ";", "}", "chunk", ".", "removeUnknownBlocks", "(", ")", ";", "return", "chunk", ";", "}", "public", "void", "saveChunk", "(", "World", "par1World", ",", "Chunk", "par2Chunk", ")", "throws", "IOException", "{", "par1World", ".", "checkSessionLock", "(", ")", ";", "try", "{", "NBTTagCompound", "nbttagcompound", "=", "new", "NBTTagCompound", "(", ")", ";", "NBTTagCompound", "nbttagcompound1", "=", "new", "NBTTagCompound", "(", ")", ";", "nbttagcompound", ".", "setTag", "(", "\"Level\"", ",", "nbttagcompound1", ")", ";", "func_48462_a", "(", "par2Chunk", ",", "par1World", ",", "nbttagcompound1", ")", ";", "func_48463_a", "(", "par2Chunk", ".", "getChunkCoordIntPair", "(", ")", ",", "nbttagcompound", ")", ";", "}", "catch", "(", "Exception", "exception", ")", "{", "exception", ".", "printStackTrace", "(", ")", ";", "}", "}", "protected", "void", "func_48463_a", "(", "ChunkCoordIntPair", "par1ChunkCoordIntPair", ",", "NBTTagCompound", "par2NBTTagCompound", ")", "{", "synchronized", "(", "field_48468_c", ")", "{", "if", "(", "field_48467_b", ".", "contains", "(", "par1ChunkCoordIntPair", ")", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "field_48469_a", ".", "size", "(", ")", ";", "i", "++", ")", "{", "if", "(", "(", "(", "AnvilChunkLoaderPending", ")", "field_48469_a", ".", "get", "(", "i", ")", ")", ".", "field_48581_a", ".", "equals", "(", "par1ChunkCoordIntPair", ")", ")", "{", "field_48469_a", ".", "set", "(", "i", ",", "new", "AnvilChunkLoaderPending", "(", "par1ChunkCoordIntPair", ",", "par2NBTTagCompound", ")", ")", ";", "return", ";", "}", "}", "}", "field_48469_a", ".", "add", "(", "new", "AnvilChunkLoaderPending", "(", "par1ChunkCoordIntPair", ",", "par2NBTTagCompound", ")", ")", ";", "field_48467_b", ".", "add", "(", "par1ChunkCoordIntPair", ")", ";", "ThreadedFileIOBase", ".", "threadedIOInstance", ".", "queueIO", "(", "this", ")", ";", "return", ";", "}", "}", "public", "boolean", "writeNextIO", "(", ")", "{", "AnvilChunkLoaderPending", "anvilchunkloaderpending", "=", "null", ";", "synchronized", "(", "field_48468_c", ")", "{", "if", "(", "field_48469_a", ".", "size", "(", ")", ">", "0", ")", "{", "anvilchunkloaderpending", "=", "(", "AnvilChunkLoaderPending", ")", "field_48469_a", ".", "remove", "(", "0", ")", ";", "field_48467_b", ".", "remove", "(", "anvilchunkloaderpending", ".", "field_48581_a", ")", ";", "}", "else", "{", "return", "false", ";", "}", "}", "if", "(", "anvilchunkloaderpending", "!=", "null", ")", "{", "try", "{", "func_48461_a", "(", "anvilchunkloaderpending", ")", ";", "}", "catch", "(", "Exception", "exception", ")", "{", "exception", ".", "printStackTrace", "(", ")", ";", "}", "}", "return", "true", ";", "}", "private", "void", "func_48461_a", "(", "AnvilChunkLoaderPending", "par1AnvilChunkLoaderPending", ")", "throws", "IOException", "{", "DataOutputStream", "dataoutputstream", "=", "RegionFileCache", ".", "getChunkOutputStream", "(", "chunkSaveLocation", ",", "par1AnvilChunkLoaderPending", ".", "field_48581_a", ".", "chunkXPos", ",", "par1AnvilChunkLoaderPending", ".", "field_48581_a", ".", "chunkZPos", ")", ";", "CompressedStreamTools", ".", "write", "(", "par1AnvilChunkLoaderPending", ".", "field_48580_b", ",", "dataoutputstream", ")", ";", "dataoutputstream", ".", "close", "(", ")", ";", "}", "public", "void", "saveExtraChunkData", "(", "World", "world", ",", "Chunk", "chunk", ")", "throws", "IOException", "{", "}", "public", "void", "chunkTick", "(", ")", "{", "}", "public", "void", "saveExtraData", "(", ")", "{", "}", "private", "void", "func_48462_a", "(", "Chunk", "par1Chunk", ",", "World", "par2World", ",", "NBTTagCompound", "par3NBTTagCompound", ")", "{", "par2World", ".", "checkSessionLock", "(", ")", ";", "par3NBTTagCompound", ".", "setInteger", "(", "\"xPos\"", ",", "par1Chunk", ".", "xPosition", ")", ";", "par3NBTTagCompound", ".", "setInteger", "(", "\"zPos\"", ",", "par1Chunk", ".", "zPosition", ")", ";", "par3NBTTagCompound", ".", "setLong", "(", "\"LastUpdate\"", ",", "par2World", ".", "getWorldTime", "(", ")", ")", ";", "par3NBTTagCompound", ".", "func_48446_a", "(", "\"HeightMap\"", ",", "par1Chunk", ".", "heightMap", ")", ";", "par3NBTTagCompound", ".", "setBoolean", "(", "\"\"", ",", "par1Chunk", ".", "isTerrainPopulated", ")", ";", "ExtendedBlockStorage", "aextendedblockstorage", "[", "]", "=", "par1Chunk", ".", "getBlockStorageArray", "(", ")", ";", "NBTTagList", "nbttaglist", "=", "new", "NBTTagList", "(", "\"Sections\"", ")", ";", "ExtendedBlockStorage", "aextendedblockstorage1", "[", "]", "=", "aextendedblockstorage", ";", "int", "i", "=", "aextendedblockstorage1", ".", "length", ";", "for", "(", "int", "k", "=", "0", ";", "k", "<", "i", ";", "k", "++", ")", "{", "ExtendedBlockStorage", "extendedblockstorage", "=", "aextendedblockstorage1", "[", "k", "]", ";", "if", "(", "extendedblockstorage", "==", "null", "||", "extendedblockstorage", ".", "func_48587_f", "(", ")", "==", "0", ")", "{", "continue", ";", "}", "NBTTagCompound", "nbttagcompound", "=", "new", "NBTTagCompound", "(", ")", ";", "nbttagcompound", ".", "setByte", "(", "\"Y\"", ",", "(", "byte", ")", "(", "extendedblockstorage", ".", "getYLocation", "(", ")", ">>", "4", "&", "0xff", ")", ")", ";", "nbttagcompound", ".", "setByteArray", "(", "\"Blocks\"", ",", "extendedblockstorage", ".", "func_48590_g", "(", ")", ")", ";", "if", "(", "extendedblockstorage", ".", "getBlockMSBArray", "(", ")", "!=", "null", ")", "{", "nbttagcompound", ".", "setByteArray", "(", "\"Add\"", ",", "extendedblockstorage", ".", "getBlockMSBArray", "(", ")", ".", "data", ")", ";", "}", "nbttagcompound", ".", "setByteArray", "(", "\"Data\"", ",", "extendedblockstorage", ".", "func_48594_i", "(", ")", ".", "data", ")", ";", "nbttagcompound", ".", "setByteArray", "(", "\"SkyLight\"", ",", "extendedblockstorage", ".", "getSkylightArray", "(", ")", ".", "data", ")", ";", "nbttagcompound", ".", "setByteArray", "(", "\"BlockLight\"", ",", "extendedblockstorage", ".", "getBlocklightArray", "(", ")", ".", "data", ")", ";", "nbttaglist", ".", "appendTag", "(", "nbttagcompound", ")", ";", "}", "par3NBTTagCompound", ".", "setTag", "(", "\"Sections\"", ",", "nbttaglist", ")", ";", "par3NBTTagCompound", ".", "setByteArray", "(", "\"Biomes\"", ",", "par1Chunk", ".", "getBiomeArray", "(", ")", ")", ";", "par1Chunk", ".", "hasEntities", "=", "false", ";", "NBTTagList", "nbttaglist1", "=", "new", "NBTTagList", "(", ")", ";", "label0", ":", "for", "(", "int", "j", "=", "0", ";", "j", "<", "par1Chunk", ".", "entityLists", ".", "length", ";", "j", "++", ")", "{", "Iterator", "iterator", "=", "par1Chunk", ".", "entityLists", "[", "j", "]", ".", "iterator", "(", ")", ";", "do", "{", "if", "(", "!", "iterator", ".", "hasNext", "(", ")", ")", "{", "continue", "label0", ";", "}", "Entity", "entity", "=", "(", "Entity", ")", "iterator", ".", "next", "(", ")", ";", "par1Chunk", ".", "hasEntities", "=", "true", ";", "NBTTagCompound", "nbttagcompound1", "=", "new", "NBTTagCompound", "(", ")", ";", "if", "(", "entity", ".", "addEntityID", "(", "nbttagcompound1", ")", ")", "{", "nbttaglist1", ".", "appendTag", "(", "nbttagcompound1", ")", ";", "}", "}", "while", "(", "true", ")", ";", "}", "par3NBTTagCompound", ".", "setTag", "(", "\"Entities\"", ",", "nbttaglist1", ")", ";", "NBTTagList", "nbttaglist2", "=", "new", "NBTTagList", "(", ")", ";", "NBTTagCompound", "nbttagcompound2", ";", "for", "(", "Iterator", "iterator1", "=", "par1Chunk", ".", "chunkTileEntityMap", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "iterator1", ".", "hasNext", "(", ")", ";", "nbttaglist2", ".", "appendTag", "(", "nbttagcompound2", ")", ")", "{", "TileEntity", "tileentity", "=", "(", "TileEntity", ")", "iterator1", ".", "next", "(", ")", ";", "nbttagcompound2", "=", "new", "NBTTagCompound", "(", ")", ";", "tileentity", ".", "writeToNBT", "(", "nbttagcompound2", ")", ";", "}", "par3NBTTagCompound", ".", "setTag", "(", "\"TileEntities\"", ",", "nbttaglist2", ")", ";", "List", "list", "=", "par2World", ".", "getPendingBlockUpdates", "(", "par1Chunk", ",", "false", ")", ";", "if", "(", "list", "!=", "null", ")", "{", "long", "l", "=", "par2World", ".", "getWorldTime", "(", ")", ";", "NBTTagList", "nbttaglist3", "=", "new", "NBTTagList", "(", ")", ";", "NBTTagCompound", "nbttagcompound3", ";", "for", "(", "Iterator", "iterator2", "=", "list", ".", "iterator", "(", ")", ";", "iterator2", ".", "hasNext", "(", ")", ";", "nbttaglist3", ".", "appendTag", "(", "nbttagcompound3", ")", ")", "{", "NextTickListEntry", "nextticklistentry", "=", "(", "NextTickListEntry", ")", "iterator2", ".", "next", "(", ")", ";", "nbttagcompound3", "=", "new", "NBTTagCompound", "(", ")", ";", "nbttagcompound3", ".", "setInteger", "(", "\"i\"", ",", "nextticklistentry", ".", "blockID", ")", ";", "nbttagcompound3", ".", "setInteger", "(", "\"x\"", ",", "nextticklistentry", ".", "xCoord", ")", ";", "nbttagcompound3", ".", "setInteger", "(", "\"y\"", ",", "nextticklistentry", ".", "yCoord", ")", ";", "nbttagcompound3", ".", "setInteger", "(", "\"z\"", ",", "nextticklistentry", ".", "zCoord", ")", ";", "nbttagcompound3", ".", "setInteger", "(", "\"t\"", ",", "(", "int", ")", "(", "nextticklistentry", ".", "scheduledTime", "-", "l", ")", ")", ";", "}", "par3NBTTagCompound", ".", "setTag", "(", "\"TileTicks\"", ",", "nbttaglist3", ")", ";", "}", "}", "private", "Chunk", "func_48465_a", "(", "World", "par1World", ",", "NBTTagCompound", "par2NBTTagCompound", ")", "{", "int", "i", "=", "par2NBTTagCompound", ".", "getInteger", "(", "\"xPos\"", ")", ";", "int", "j", "=", "par2NBTTagCompound", ".", "getInteger", "(", "\"zPos\"", ")", ";", "Chunk", "chunk", "=", "new", "Chunk", "(", "par1World", ",", "i", ",", "j", ")", ";", "chunk", ".", "heightMap", "=", "par2NBTTagCompound", ".", "func_48445_l", "(", "\"HeightMap\"", ")", ";", "chunk", ".", "isTerrainPopulated", "=", "par2NBTTagCompound", ".", "getBoolean", "(", "\"\"", ")", ";", "NBTTagList", "nbttaglist", "=", "par2NBTTagCompound", ".", "getTagList", "(", "\"Sections\"", ")", ";", "byte", "byte0", "=", "16", ";", "ExtendedBlockStorage", "aextendedblockstorage", "[", "]", "=", "new", "ExtendedBlockStorage", "[", "byte0", "]", ";", "for", "(", "int", "k", "=", "0", ";", "k", "<", "nbttaglist", ".", "tagCount", "(", ")", ";", "k", "++", ")", "{", "NBTTagCompound", "nbttagcompound", "=", "(", "NBTTagCompound", ")", "nbttaglist", ".", "tagAt", "(", "k", ")", ";", "byte", "byte1", "=", "nbttagcompound", ".", "getByte", "(", "\"Y\"", ")", ";", "ExtendedBlockStorage", "extendedblockstorage", "=", "new", "ExtendedBlockStorage", "(", "byte1", "<<", "4", ")", ";", "extendedblockstorage", ".", "setBlockLSBArray", "(", "nbttagcompound", ".", "getByteArray", "(", "\"Blocks\"", ")", ")", ";", "if", "(", "nbttagcompound", ".", "hasKey", "(", "\"Add\"", ")", ")", "{", "extendedblockstorage", ".", "setBlockMSBArray", "(", "new", "NibbleArray", "(", "nbttagcompound", ".", "getByteArray", "(", "\"Add\"", ")", ",", "4", ")", ")", ";", "}", "extendedblockstorage", ".", "setBlockMetadataArray", "(", "new", "NibbleArray", "(", "nbttagcompound", ".", "getByteArray", "(", "\"Data\"", ")", ",", "4", ")", ")", ";", "extendedblockstorage", ".", "setSkylightArray", "(", "new", "NibbleArray", "(", "nbttagcompound", ".", "getByteArray", "(", "\"SkyLight\"", ")", ",", "4", ")", ")", ";", "extendedblockstorage", ".", "setBlocklightArray", "(", "new", "NibbleArray", "(", "nbttagcompound", ".", "getByteArray", "(", "\"BlockLight\"", ")", ",", "4", ")", ")", ";", "extendedblockstorage", ".", "func_48599_d", "(", ")", ";", "aextendedblockstorage", "[", "byte1", "]", "=", "extendedblockstorage", ";", "}", "chunk", ".", "setStorageArrays", "(", "aextendedblockstorage", ")", ";", "if", "(", "par2NBTTagCompound", ".", "hasKey", "(", "\"Biomes\"", ")", ")", "{", "chunk", ".", "setBiomeArray", "(", "par2NBTTagCompound", ".", "getByteArray", "(", "\"Biomes\"", ")", ")", ";", "}", "NBTTagList", "nbttaglist1", "=", "par2NBTTagCompound", ".", "getTagList", "(", "\"Entities\"", ")", ";", "if", "(", "nbttaglist1", "!=", "null", ")", "{", "for", "(", "int", "l", "=", "0", ";", "l", "<", "nbttaglist1", ".", "tagCount", "(", ")", ";", "l", "++", ")", "{", "NBTTagCompound", "nbttagcompound1", "=", "(", "NBTTagCompound", ")", "nbttaglist1", ".", "tagAt", "(", "l", ")", ";", "Entity", "entity", "=", "EntityList", ".", "createEntityFromNBT", "(", "nbttagcompound1", ",", "par1World", ")", ";", "chunk", ".", "hasEntities", "=", "true", ";", "if", "(", "entity", "!=", "null", ")", "{", "chunk", ".", "addEntity", "(", "entity", ")", ";", "}", "}", "}", "NBTTagList", "nbttaglist2", "=", "par2NBTTagCompound", ".", "getTagList", "(", "\"TileEntities\"", ")", ";", "if", "(", "nbttaglist2", "!=", "null", ")", "{", "for", "(", "int", "i1", "=", "0", ";", "i1", "<", "nbttaglist2", ".", "tagCount", "(", ")", ";", "i1", "++", ")", "{", "NBTTagCompound", "nbttagcompound2", "=", "(", "NBTTagCompound", ")", "nbttaglist2", ".", "tagAt", "(", "i1", ")", ";", "TileEntity", "tileentity", "=", "TileEntity", ".", "createAndLoadEntity", "(", "nbttagcompound2", ")", ";", "if", "(", "tileentity", "!=", "null", ")", "{", "chunk", ".", "addTileEntity", "(", "tileentity", ")", ";", "}", "}", "}", "if", "(", "par2NBTTagCompound", ".", "hasKey", "(", "\"TileTicks\"", ")", ")", "{", "NBTTagList", "nbttaglist3", "=", "par2NBTTagCompound", ".", "getTagList", "(", "\"TileTicks\"", ")", ";", "if", "(", "nbttaglist3", "!=", "null", ")", "{", "for", "(", "int", "j1", "=", "0", ";", "j1", "<", "nbttaglist3", ".", "tagCount", "(", ")", ";", "j1", "++", ")", "{", "NBTTagCompound", "nbttagcompound3", "=", "(", "NBTTagCompound", ")", "nbttaglist3", ".", "tagAt", "(", "j1", ")", ";", "par1World", ".", "scheduleBlockUpdateFromLoad", "(", "nbttagcompound3", ".", "getInteger", "(", "\"x\"", ")", ",", "nbttagcompound3", ".", "getInteger", "(", "\"y\"", ")", ",", "nbttagcompound3", ".", "getInteger", "(", "\"z\"", ")", ",", "nbttagcompound3", ".", "getInteger", "(", "\"i\"", ")", ",", "nbttagcompound3", ".", "getInteger", "(", "\"t\"", ")", ")", ";", "}", "}", "}", "return", "chunk", ";", "}", "}", "</s>" ]
9,959
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "List", ";", "public", "class", "ContainerDispenser", "extends", "Container", "{", "private", "TileEntityDispenser", "tileEntityDispenser", ";", "public", "ContainerDispenser", "(", "IInventory", "par1IInventory", ",", "TileEntityDispenser", "par2TileEntityDispenser", ")", "{", "tileEntityDispenser", "=", "par2TileEntityDispenser", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "3", ";", "i", "++", ")", "{", "for", "(", "int", "l", "=", "0", ";", "l", "<", "3", ";", "l", "++", ")", "{", "addSlot", "(", "new", "Slot", "(", "par2TileEntityDispenser", ",", "l", "+", "i", "*", "3", ",", "62", "+", "l", "*", "18", ",", "17", "+", "i", "*", "18", ")", ")", ";", "}", "}", "for", "(", "int", "j", "=", "0", ";", "j", "<", "3", ";", "j", "++", ")", "{", "for", "(", "int", "i1", "=", "0", ";", "i1", "<", "9", ";", "i1", "++", ")", "{", "addSlot", "(", "new", "Slot", "(", "par1IInventory", ",", "i1", "+", "j", "*", "9", "+", "9", ",", "8", "+", "i1", "*", "18", ",", "84", "+", "j", "*", "18", ")", ")", ";", "}", "}", "for", "(", "int", "k", "=", "0", ";", "k", "<", "9", ";", "k", "++", ")", "{", "addSlot", "(", "new", "Slot", "(", "par1IInventory", ",", "k", ",", "8", "+", "k", "*", "18", ",", "142", ")", ")", ";", "}", "}", "public", "boolean", "canInteractWith", "(", "EntityPlayer", "par1EntityPlayer", ")", "{", "return", "tileEntityDispenser", ".", "isUseableByPlayer", "(", "par1EntityPlayer", ")", ";", "}", "public", "ItemStack", "transferStackInSlot", "(", "int", "par1", ")", "{", "ItemStack", "itemstack", "=", "null", ";", "Slot", "slot", "=", "(", "Slot", ")", "inventorySlots", ".", "get", "(", "par1", ")", ";", "if", "(", "slot", "!=", "null", "&&", "slot", ".", "getHasStack", "(", ")", ")", "{", "ItemStack", "itemstack1", "=", "slot", ".", "getStack", "(", ")", ";", "itemstack", "=", "itemstack1", ".", "copy", "(", ")", ";", "if", "(", "par1", "<", "9", ")", "{", "if", "(", "!", "mergeItemStack", "(", "itemstack1", ",", "9", ",", "45", ",", "true", ")", ")", "{", "return", "null", ";", "}", "}", "else", "if", "(", "!", "mergeItemStack", "(", "itemstack1", ",", "0", ",", "9", ",", "false", ")", ")", "{", "return", "null", ";", "}", "if", "(", "itemstack1", ".", "stackSize", "==", "0", ")", "{", "slot", ".", "putStack", "(", "null", ")", ";", "}", "else", "{", "slot", ".", "onSlotChanged", "(", ")", ";", "}", "if", "(", "itemstack1", ".", "stackSize", "!=", "itemstack", ".", "stackSize", ")", "{", "slot", ".", "onPickupFromSlot", "(", "itemstack1", ")", ";", "}", "else", "{", "return", "null", ";", "}", "}", "return", "itemstack", ";", "}", "}", "</s>" ]
9,960
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "Random", ";", "public", "abstract", "class", "EntityMob", "extends", "EntityCreature", "implements", "IMob", "{", "protected", "int", "attackStrength", ";", "public", "EntityMob", "(", "World", "par1World", ")", "{", "super", "(", "par1World", ")", ";", "attackStrength", "=", "2", ";", "experienceValue", "=", "5", ";", "}", "public", "void", "onLivingUpdate", "(", ")", "{", "float", "f", "=", "getBrightness", "(", "1.0F", ")", ";", "if", "(", "f", ">", "0.5F", ")", "{", "entityAge", "+=", "2", ";", "}", "super", ".", "onLivingUpdate", "(", ")", ";", "}", "public", "void", "onUpdate", "(", ")", "{", "super", ".", "onUpdate", "(", ")", ";", "if", "(", "!", "worldObj", ".", "isRemote", "&&", "worldObj", ".", "difficultySetting", "==", "0", ")", "{", "setDead", "(", ")", ";", "}", "}", "protected", "Entity", "findPlayerToAttack", "(", ")", "{", "EntityPlayer", "entityplayer", "=", "worldObj", ".", "getClosestVulnerablePlayerToEntity", "(", "this", ",", "16D", ")", ";", "if", "(", "entityplayer", "!=", "null", "&&", "canEntityBeSeen", "(", "entityplayer", ")", ")", "{", "return", "entityplayer", ";", "}", "else", "{", "return", "null", ";", "}", "}", "public", "boolean", "attackEntityFrom", "(", "DamageSource", "par1DamageSource", ",", "int", "par2", ")", "{", "if", "(", "super", ".", "attackEntityFrom", "(", "par1DamageSource", ",", "par2", ")", ")", "{", "Entity", "entity", "=", "par1DamageSource", ".", "getEntity", "(", ")", ";", "if", "(", "riddenByEntity", "==", "entity", "||", "ridingEntity", "==", "entity", ")", "{", "return", "true", ";", "}", "if", "(", "entity", "!=", "this", ")", "{", "entityToAttack", "=", "entity", ";", "}", "return", "true", ";", "}", "else", "{", "return", "false", ";", "}", "}", "public", "boolean", "attackEntityAsMob", "(", "Entity", "par1Entity", ")", "{", "int", "i", "=", "attackStrength", ";", "if", "(", "isPotionActive", "(", "Potion", ".", "damageBoost", ")", ")", "{", "i", "+=", "3", "<<", "getActivePotionEffect", "(", "Potion", ".", "damageBoost", ")", ".", "getAmplifier", "(", ")", ";", "}", "if", "(", "isPotionActive", "(", "Potion", ".", "weakness", ")", ")", "{", "i", "-=", "2", "<<", "getActivePotionEffect", "(", "Potion", ".", "weakness", ")", ".", "getAmplifier", "(", ")", ";", "}", "return", "par1Entity", ".", "attackEntityFrom", "(", "DamageSource", ".", "causeMobDamage", "(", "this", ")", ",", "i", ")", ";", "}", "protected", "void", "attackEntity", "(", "Entity", "par1Entity", ",", "float", "par2", ")", "{", "if", "(", "attackTime", "<=", "0", "&&", "par2", "<", "2.0F", "&&", "par1Entity", ".", "boundingBox", ".", "maxY", ">", "boundingBox", ".", "minY", "&&", "par1Entity", ".", "boundingBox", ".", "minY", "<", "boundingBox", ".", "maxY", ")", "{", "attackTime", "=", "20", ";", "attackEntityAsMob", "(", "par1Entity", ")", ";", "}", "}", "public", "float", "getBlockPathWeight", "(", "int", "par1", ",", "int", "par2", ",", "int", "par3", ")", "{", "return", "0.5F", "-", "worldObj", ".", "getLightBrightness", "(", "par1", ",", "par2", ",", "par3", ")", ";", "}", "public", "void", "writeEntityToNBT", "(", "NBTTagCompound", "par1NBTTagCompound", ")", "{", "super", ".", "writeEntityToNBT", "(", "par1NBTTagCompound", ")", ";", "}", "public", "void", "readEntityFromNBT", "(", "NBTTagCompound", "par1NBTTagCompound", ")", "{", "super", ".", "readEntityFromNBT", "(", "par1NBTTagCompound", ")", ";", "}", "protected", "boolean", "isValidLightLevel", "(", ")", "{", "int", "i", "=", "MathHelper", ".", "floor_double", "(", "posX", ")", ";", "int", "j", "=", "MathHelper", ".", "floor_double", "(", "boundingBox", ".", "minY", ")", ";", "int", "k", "=", "MathHelper", ".", "floor_double", "(", "posZ", ")", ";", "if", "(", "worldObj", ".", "getSavedLightValue", "(", "EnumSkyBlock", ".", "Sky", ",", "i", ",", "j", ",", "k", ")", ">", "rand", ".", "nextInt", "(", "32", ")", ")", "{", "return", "false", ";", "}", "int", "l", "=", "worldObj", ".", "getBlockLightValue", "(", "i", ",", "j", ",", "k", ")", ";", "if", "(", "worldObj", ".", "isThundering", "(", ")", ")", "{", "int", "i1", "=", "worldObj", ".", "skylightSubtracted", ";", "worldObj", ".", "skylightSubtracted", "=", "10", ";", "l", "=", "worldObj", ".", "getBlockLightValue", "(", "i", ",", "j", ",", "k", ")", ";", "worldObj", ".", "skylightSubtracted", "=", "i1", ";", "}", "return", "l", "<=", "rand", ".", "nextInt", "(", "8", ")", ";", "}", "public", "boolean", "getCanSpawnHere", "(", ")", "{", "return", "isValidLightLevel", "(", ")", "&&", "super", ".", "getCanSpawnHere", "(", ")", ";", "}", "}", "</s>" ]
9,961
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Random", ";", "public", "class", "ComponentVillageStartPiece", "extends", "ComponentVillageWell", "{", "public", "WorldChunkManager", "worldChunkMngr", ";", "public", "int", "terrainType", ";", "public", "StructureVillagePieceWeight", "structVillagePieceWeight", ";", "public", "ArrayList", "structureVillageWeightedPieceList", ";", "public", "ArrayList", "field_35389_e", ";", "public", "ArrayList", "field_35387_f", ";", "public", "ComponentVillageStartPiece", "(", "WorldChunkManager", "par1WorldChunkManager", ",", "int", "par2", ",", "Random", "par3Random", ",", "int", "par4", ",", "int", "par5", ",", "ArrayList", "par6ArrayList", ",", "int", "par7", ")", "{", "super", "(", "0", ",", "par3Random", ",", "par4", ",", "par5", ")", ";", "field_35389_e", "=", "new", "ArrayList", "(", ")", ";", "field_35387_f", "=", "new", "ArrayList", "(", ")", ";", "worldChunkMngr", "=", "par1WorldChunkManager", ";", "structureVillageWeightedPieceList", "=", "par6ArrayList", ";", "terrainType", "=", "par7", ";", "}", "public", "WorldChunkManager", "getWorldChunkManager", "(", ")", "{", "return", "worldChunkMngr", ";", "}", "}", "</s>" ]
9,962
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Random", ";", "public", "class", "ComponentMineshaftCross", "extends", "StructureComponent", "{", "private", "final", "int", "corridorDirection", ";", "private", "final", "boolean", "isMultipleFloors", ";", "public", "ComponentMineshaftCross", "(", "int", "par1", ",", "Random", "par2Random", ",", "StructureBoundingBox", "par3StructureBoundingBox", ",", "int", "par4", ")", "{", "super", "(", "par1", ")", ";", "corridorDirection", "=", "par4", ";", "boundingBox", "=", "par3StructureBoundingBox", ";", "isMultipleFloors", "=", "par3StructureBoundingBox", ".", "getYSize", "(", ")", ">", "3", ";", "}", "public", "static", "StructureBoundingBox", "findValidPlacement", "(", "List", "par0List", ",", "Random", "par1Random", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "int", "par5", ")", "{", "StructureBoundingBox", "structureboundingbox", "=", "new", "StructureBoundingBox", "(", "par2", ",", "par3", ",", "par4", ",", "par2", ",", "par3", "+", "2", ",", "par4", ")", ";", "if", "(", "par1Random", ".", "nextInt", "(", "4", ")", "==", "0", ")", "{", "structureboundingbox", ".", "maxY", "+=", "4", ";", "}", "switch", "(", "par5", ")", "{", "case", "2", ":", "structureboundingbox", ".", "minX", "=", "par2", "-", "1", ";", "structureboundingbox", ".", "maxX", "=", "par2", "+", "3", ";", "structureboundingbox", ".", "minZ", "=", "par4", "-", "4", ";", "break", ";", "case", "0", ":", "structureboundingbox", ".", "minX", "=", "par2", "-", "1", ";", "structureboundingbox", ".", "maxX", "=", "par2", "+", "3", ";", "structureboundingbox", ".", "maxZ", "=", "par4", "+", "4", ";", "break", ";", "case", "1", ":", "structureboundingbox", ".", "minX", "=", "par2", "-", "4", ";", "structureboundingbox", ".", "minZ", "=", "par4", "-", "1", ";", "structureboundingbox", ".", "maxZ", "=", "par4", "+", "3", ";", "break", ";", "case", "3", ":", "structureboundingbox", ".", "maxX", "=", "par2", "+", "4", ";", "structureboundingbox", ".", "minZ", "=", "par4", "-", "1", ";", "structureboundingbox", ".", "maxZ", "=", "par4", "+", "3", ";", "break", ";", "}", "if", "(", "StructureComponent", ".", "findIntersecting", "(", "par0List", ",", "structureboundingbox", ")", "!=", "null", ")", "{", "return", "null", ";", "}", "else", "{", "return", "structureboundingbox", ";", "}", "}", "public", "void", "buildComponent", "(", "StructureComponent", "par1StructureComponent", ",", "List", "par2List", ",", "Random", "par3Random", ")", "{", "int", "i", "=", "getComponentType", "(", ")", ";", "switch", "(", "corridorDirection", ")", "{", "case", "2", ":", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", "+", "1", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "minZ", "-", "1", ",", "2", ",", "i", ")", ";", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", "-", "1", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "minZ", "+", "1", ",", "1", ",", "i", ")", ";", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "maxX", "+", "1", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "minZ", "+", "1", ",", "3", ",", "i", ")", ";", "break", ";", "case", "0", ":", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", "+", "1", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "maxZ", "+", "1", ",", "0", ",", "i", ")", ";", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", "-", "1", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "minZ", "+", "1", ",", "1", ",", "i", ")", ";", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "maxX", "+", "1", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "minZ", "+", "1", ",", "3", ",", "i", ")", ";", "break", ";", "case", "1", ":", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", "+", "1", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "minZ", "-", "1", ",", "2", ",", "i", ")", ";", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", "+", "1", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "maxZ", "+", "1", ",", "0", ",", "i", ")", ";", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", "-", "1", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "minZ", "+", "1", ",", "1", ",", "i", ")", ";", "break", ";", "case", "3", ":", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", "+", "1", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "minZ", "-", "1", ",", "2", ",", "i", ")", ";", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", "+", "1", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "maxZ", "+", "1", ",", "0", ",", "i", ")", ";", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "maxX", "+", "1", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "minZ", "+", "1", ",", "3", ",", "i", ")", ";", "break", ";", "}", "if", "(", "isMultipleFloors", ")", "{", "if", "(", "par3Random", ".", "nextBoolean", "(", ")", ")", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", "+", "1", ",", "boundingBox", ".", "minY", "+", "3", "+", "1", ",", "boundingBox", ".", "minZ", "-", "1", ",", "2", ",", "i", ")", ";", "}", "if", "(", "par3Random", ".", "nextBoolean", "(", ")", ")", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", "-", "1", ",", "boundingBox", ".", "minY", "+", "3", "+", "1", ",", "boundingBox", ".", "minZ", "+", "1", ",", "1", ",", "i", ")", ";", "}", "if", "(", "par3Random", ".", "nextBoolean", "(", ")", ")", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "maxX", "+", "1", ",", "boundingBox", ".", "minY", "+", "3", "+", "1", ",", "boundingBox", ".", "minZ", "+", "1", ",", "3", ",", "i", ")", ";", "}", "if", "(", "par3Random", ".", "nextBoolean", "(", ")", ")", "{", "StructureMineshaftPieces", ".", "getNextComponent", "(", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "boundingBox", ".", "minX", "+", "1", ",", "boundingBox", ".", "minY", "+", "3", "+", "1", ",", "boundingBox", ".", "maxZ", "+", "1", ",", "0", ",", "i", ")", ";", "}", "}", "}", "public", "boolean", "addComponentParts", "(", "World", "par1World", ",", "Random", "par2Random", ",", "StructureBoundingBox", "par3StructureBoundingBox", ")", "{", "if", "(", "isLiquidInStructureBoundingBox", "(", "par1World", ",", "par3StructureBoundingBox", ")", ")", "{", "return", "false", ";", "}", "if", "(", "isMultipleFloors", ")", "{", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "boundingBox", ".", "minX", "+", "1", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "minZ", ",", "boundingBox", ".", "maxX", "-", "1", ",", "(", "boundingBox", ".", "minY", "+", "3", ")", "-", "1", ",", "boundingBox", ".", "maxZ", ",", "0", ",", "0", ",", "false", ")", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "boundingBox", ".", "minX", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "minZ", "+", "1", ",", "boundingBox", ".", "maxX", ",", "(", "boundingBox", ".", "minY", "+", "3", ")", "-", "1", ",", "boundingBox", ".", "maxZ", "-", "1", ",", "0", ",", "0", ",", "false", ")", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "boundingBox", ".", "minX", "+", "1", ",", "boundingBox", ".", "maxY", "-", "2", ",", "boundingBox", ".", "minZ", ",", "boundingBox", ".", "maxX", "-", "1", ",", "boundingBox", ".", "maxY", ",", "boundingBox", ".", "maxZ", ",", "0", ",", "0", ",", "false", ")", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "boundingBox", ".", "minX", ",", "boundingBox", ".", "maxY", "-", "2", ",", "boundingBox", ".", "minZ", "+", "1", ",", "boundingBox", ".", "maxX", ",", "boundingBox", ".", "maxY", ",", "boundingBox", ".", "maxZ", "-", "1", ",", "0", ",", "0", ",", "false", ")", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "boundingBox", ".", "minX", "+", "1", ",", "boundingBox", ".", "minY", "+", "3", ",", "boundingBox", ".", "minZ", "+", "1", ",", "boundingBox", ".", "maxX", "-", "1", ",", "boundingBox", ".", "minY", "+", "3", ",", "boundingBox", ".", "maxZ", "-", "1", ",", "0", ",", "0", ",", "false", ")", ";", "}", "else", "{", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "boundingBox", ".", "minX", "+", "1", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "minZ", ",", "boundingBox", ".", "maxX", "-", "1", ",", "boundingBox", ".", "maxY", ",", "boundingBox", ".", "maxZ", ",", "0", ",", "0", ",", "false", ")", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "boundingBox", ".", "minX", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "minZ", "+", "1", ",", "boundingBox", ".", "maxX", ",", "boundingBox", ".", "maxY", ",", "boundingBox", ".", "maxZ", "-", "1", ",", "0", ",", "0", ",", "false", ")", ";", "}", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "boundingBox", ".", "minX", "+", "1", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "minZ", "+", "1", ",", "boundingBox", ".", "minX", "+", "1", ",", "boundingBox", ".", "maxY", ",", "boundingBox", ".", "minZ", "+", "1", ",", "Block", ".", "planks", ".", "blockID", ",", "0", ",", "false", ")", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "boundingBox", ".", "minX", "+", "1", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "maxZ", "-", "1", ",", "boundingBox", ".", "minX", "+", "1", ",", "boundingBox", ".", "maxY", ",", "boundingBox", ".", "maxZ", "-", "1", ",", "Block", ".", "planks", ".", "blockID", ",", "0", ",", "false", ")", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "boundingBox", ".", "maxX", "-", "1", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "minZ", "+", "1", ",", "boundingBox", ".", "maxX", "-", "1", ",", "boundingBox", ".", "maxY", ",", "boundingBox", ".", "minZ", "+", "1", ",", "Block", ".", "planks", ".", "blockID", ",", "0", ",", "false", ")", ";", "fillWithBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "boundingBox", ".", "maxX", "-", "1", ",", "boundingBox", ".", "minY", ",", "boundingBox", ".", "maxZ", "-", "1", ",", "boundingBox", ".", "maxX", "-", "1", ",", "boundingBox", ".", "maxY", ",", "boundingBox", ".", "maxZ", "-", "1", ",", "Block", ".", "planks", ".", "blockID", ",", "0", ",", "false", ")", ";", "for", "(", "int", "i", "=", "boundingBox", ".", "minX", ";", "i", "<=", "boundingBox", ".", "maxX", ";", "i", "++", ")", "{", "for", "(", "int", "j", "=", "boundingBox", ".", "minZ", ";", "j", "<=", "boundingBox", ".", "maxZ", ";", "j", "++", ")", "{", "int", "k", "=", "getBlockIdAtCurrentPosition", "(", "par1World", ",", "i", ",", "boundingBox", ".", "minY", "-", "1", ",", "j", ",", "par3StructureBoundingBox", ")", ";", "if", "(", "k", "==", "0", ")", "{", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "planks", ".", "blockID", ",", "0", ",", "i", ",", "boundingBox", ".", "minY", "-", "1", ",", "j", ",", "par3StructureBoundingBox", ")", ";", "}", "}", "}", "return", "true", ";", "}", "}", "</s>" ]
9,963
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "ItemLilyPad", "extends", "ItemColored", "{", "public", "ItemLilyPad", "(", "int", "par1", ")", "{", "super", "(", "par1", ",", "false", ")", ";", "}", "public", "ItemStack", "onItemRightClick", "(", "ItemStack", "par1ItemStack", ",", "World", "par2World", ",", "EntityPlayer", "par3EntityPlayer", ")", "{", "MovingObjectPosition", "movingobjectposition", "=", "getMovingObjectPositionFromPlayer", "(", "par2World", ",", "par3EntityPlayer", ",", "true", ")", ";", "if", "(", "movingobjectposition", "==", "null", ")", "{", "return", "par1ItemStack", ";", "}", "if", "(", "movingobjectposition", ".", "typeOfHit", "==", "EnumMovingObjectType", ".", "TILE", ")", "{", "int", "i", "=", "movingobjectposition", ".", "blockX", ";", "int", "j", "=", "movingobjectposition", ".", "blockY", ";", "int", "k", "=", "movingobjectposition", ".", "blockZ", ";", "if", "(", "!", "par2World", ".", "canMineBlock", "(", "par3EntityPlayer", ",", "i", ",", "j", ",", "k", ")", ")", "{", "return", "par1ItemStack", ";", "}", "if", "(", "!", "par3EntityPlayer", ".", "canPlayerEdit", "(", "i", ",", "j", ",", "k", ")", ")", "{", "return", "par1ItemStack", ";", "}", "if", "(", "par2World", ".", "getBlockMaterial", "(", "i", ",", "j", ",", "k", ")", "==", "Material", ".", "water", "&&", "par2World", ".", "getBlockMetadata", "(", "i", ",", "j", ",", "k", ")", "==", "0", "&&", "par2World", ".", "isAirBlock", "(", "i", ",", "j", "+", "1", ",", "k", ")", ")", "{", "par2World", ".", "setBlockWithNotify", "(", "i", ",", "j", "+", "1", ",", "k", ",", "Block", ".", "waterlily", ".", "blockID", ")", ";", "if", "(", "!", "par3EntityPlayer", ".", "capabilities", ".", "isCreativeMode", ")", "{", "par1ItemStack", ".", "stackSize", "--", ";", "}", "}", "}", "return", "par1ItemStack", ";", "}", "}", "</s>" ]
9,964
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "io", ".", "*", ";", "public", "class", "Packet19EntityAction", "extends", "Packet", "{", "public", "int", "entityId", ";", "public", "int", "state", ";", "public", "Packet19EntityAction", "(", ")", "{", "}", "public", "void", "readPacketData", "(", "DataInputStream", "par1DataInputStream", ")", "throws", "IOException", "{", "entityId", "=", "par1DataInputStream", ".", "readInt", "(", ")", ";", "state", "=", "par1DataInputStream", ".", "readByte", "(", ")", ";", "}", "public", "void", "writePacketData", "(", "DataOutputStream", "par1DataOutputStream", ")", "throws", "IOException", "{", "par1DataOutputStream", ".", "writeInt", "(", "entityId", ")", ";", "par1DataOutputStream", ".", "writeByte", "(", "state", ")", ";", "}", "public", "void", "processPacket", "(", "NetHandler", "par1NetHandler", ")", "{", "par1NetHandler", ".", "handleEntityAction", "(", "this", ")", ";", "}", "public", "int", "getPacketSize", "(", ")", "{", "return", "5", ";", "}", "}", "</s>" ]
9,965
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "io", ".", "*", ";", "public", "class", "Packet12PlayerLook", "extends", "Packet10Flying", "{", "public", "Packet12PlayerLook", "(", ")", "{", "rotating", "=", "true", ";", "}", "public", "void", "readPacketData", "(", "DataInputStream", "par1DataInputStream", ")", "throws", "IOException", "{", "yaw", "=", "par1DataInputStream", ".", "readFloat", "(", ")", ";", "pitch", "=", "par1DataInputStream", ".", "readFloat", "(", ")", ";", "super", ".", "readPacketData", "(", "par1DataInputStream", ")", ";", "}", "public", "void", "writePacketData", "(", "DataOutputStream", "par1DataOutputStream", ")", "throws", "IOException", "{", "par1DataOutputStream", ".", "writeFloat", "(", "yaw", ")", ";", "par1DataOutputStream", ".", "writeFloat", "(", "pitch", ")", ";", "super", ".", "writePacketData", "(", "par1DataOutputStream", ")", ";", "}", "public", "int", "getPacketSize", "(", ")", "{", "return", "9", ";", "}", "}", "</s>" ]
9,966
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "Random", ";", "public", "class", "WorldGenMinable", "extends", "WorldGenerator", "{", "private", "int", "minableBlockId", ";", "private", "int", "numberOfBlocks", ";", "public", "WorldGenMinable", "(", "int", "par1", ",", "int", "par2", ")", "{", "minableBlockId", "=", "par1", ";", "numberOfBlocks", "=", "par2", ";", "}", "public", "boolean", "generate", "(", "World", "par1World", ",", "Random", "par2Random", ",", "int", "par3", ",", "int", "par4", ",", "int", "par5", ")", "{", "float", "f", "=", "par2Random", ".", "nextFloat", "(", ")", "*", "(", "float", ")", "Math", ".", "PI", ";", "double", "d", "=", "(", "float", ")", "(", "par3", "+", "8", ")", "+", "(", "MathHelper", ".", "sin", "(", "f", ")", "*", "(", "float", ")", "numberOfBlocks", ")", "/", "8F", ";", "double", "d1", "=", "(", "float", ")", "(", "par3", "+", "8", ")", "-", "(", "MathHelper", ".", "sin", "(", "f", ")", "*", "(", "float", ")", "numberOfBlocks", ")", "/", "8F", ";", "double", "d2", "=", "(", "float", ")", "(", "par5", "+", "8", ")", "+", "(", "MathHelper", ".", "cos", "(", "f", ")", "*", "(", "float", ")", "numberOfBlocks", ")", "/", "8F", ";", "double", "d3", "=", "(", "float", ")", "(", "par5", "+", "8", ")", "-", "(", "MathHelper", ".", "cos", "(", "f", ")", "*", "(", "float", ")", "numberOfBlocks", ")", "/", "8F", ";", "double", "d4", "=", "(", "par4", "+", "par2Random", ".", "nextInt", "(", "3", ")", ")", "-", "2", ";", "double", "d5", "=", "(", "par4", "+", "par2Random", ".", "nextInt", "(", "3", ")", ")", "-", "2", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<=", "numberOfBlocks", ";", "i", "++", ")", "{", "double", "d6", "=", "d", "+", "(", "(", "d1", "-", "d", ")", "*", "(", "double", ")", "i", ")", "/", "(", "double", ")", "numberOfBlocks", ";", "double", "d7", "=", "d4", "+", "(", "(", "d5", "-", "d4", ")", "*", "(", "double", ")", "i", ")", "/", "(", "double", ")", "numberOfBlocks", ";", "double", "d8", "=", "d2", "+", "(", "(", "d3", "-", "d2", ")", "*", "(", "double", ")", "i", ")", "/", "(", "double", ")", "numberOfBlocks", ";", "double", "d9", "=", "(", "par2Random", ".", "nextDouble", "(", ")", "*", "(", "double", ")", "numberOfBlocks", ")", "/", "16D", ";", "double", "d10", "=", "(", "double", ")", "(", "MathHelper", ".", "sin", "(", "(", "(", "float", ")", "i", "*", "(", "float", ")", "Math", ".", "PI", ")", "/", "(", "float", ")", "numberOfBlocks", ")", "+", "1.0F", ")", "*", "d9", "+", "1.0D", ";", "double", "d11", "=", "(", "double", ")", "(", "MathHelper", ".", "sin", "(", "(", "(", "float", ")", "i", "*", "(", "float", ")", "Math", ".", "PI", ")", "/", "(", "float", ")", "numberOfBlocks", ")", "+", "1.0F", ")", "*", "d9", "+", "1.0D", ";", "int", "j", "=", "MathHelper", ".", "floor_double", "(", "d6", "-", "d10", "/", "2D", ")", ";", "int", "k", "=", "MathHelper", ".", "floor_double", "(", "d7", "-", "d11", "/", "2D", ")", ";", "int", "l", "=", "MathHelper", ".", "floor_double", "(", "d8", "-", "d10", "/", "2D", ")", ";", "int", "i1", "=", "MathHelper", ".", "floor_double", "(", "d6", "+", "d10", "/", "2D", ")", ";", "int", "j1", "=", "MathHelper", ".", "floor_double", "(", "d7", "+", "d11", "/", "2D", ")", ";", "int", "k1", "=", "MathHelper", ".", "floor_double", "(", "d8", "+", "d10", "/", "2D", ")", ";", "for", "(", "int", "l1", "=", "j", ";", "l1", "<=", "i1", ";", "l1", "++", ")", "{", "double", "d12", "=", "(", "(", "(", "double", ")", "l1", "+", "0.5D", ")", "-", "d6", ")", "/", "(", "d10", "/", "2D", ")", ";", "if", "(", "d12", "*", "d12", ">=", "1.0D", ")", "{", "continue", ";", "}", "for", "(", "int", "i2", "=", "k", ";", "i2", "<=", "j1", ";", "i2", "++", ")", "{", "double", "d13", "=", "(", "(", "(", "double", ")", "i2", "+", "0.5D", ")", "-", "d7", ")", "/", "(", "d11", "/", "2D", ")", ";", "if", "(", "d12", "*", "d12", "+", "d13", "*", "d13", ">=", "1.0D", ")", "{", "continue", ";", "}", "for", "(", "int", "j2", "=", "l", ";", "j2", "<=", "k1", ";", "j2", "++", ")", "{", "double", "d14", "=", "(", "(", "(", "double", ")", "j2", "+", "0.5D", ")", "-", "d8", ")", "/", "(", "d10", "/", "2D", ")", ";", "if", "(", "d12", "*", "d12", "+", "d13", "*", "d13", "+", "d14", "*", "d14", "<", "1.0D", "&&", "par1World", ".", "getBlockId", "(", "l1", ",", "i2", ",", "j2", ")", "==", "Block", ".", "stone", ".", "blockID", ")", "{", "par1World", ".", "setBlock", "(", "l1", ",", "i2", ",", "j2", ",", "minableBlockId", ")", ";", "}", "}", "}", "}", "}", "return", "true", ";", "}", "}", "</s>" ]
9,967
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Random", ";", "public", "class", "ComponentStrongholdStairs", "extends", "ComponentStronghold", "{", "private", "final", "boolean", "field_35327_a", ";", "private", "final", "EnumDoor", "doorType", ";", "public", "ComponentStrongholdStairs", "(", "int", "par1", ",", "Random", "par2Random", ",", "int", "par3", ",", "int", "par4", ")", "{", "super", "(", "par1", ")", ";", "field_35327_a", "=", "true", ";", "coordBaseMode", "=", "par2Random", ".", "nextInt", "(", "4", ")", ";", "doorType", "=", "EnumDoor", ".", "OPENING", ";", "switch", "(", "coordBaseMode", ")", "{", "case", "0", ":", "case", "2", ":", "boundingBox", "=", "new", "StructureBoundingBox", "(", "par3", ",", "64", ",", "par4", ",", "(", "par3", "+", "5", ")", "-", "1", ",", "74", ",", "(", "par4", "+", "5", ")", "-", "1", ")", ";", "break", ";", "default", ":", "boundingBox", "=", "new", "StructureBoundingBox", "(", "par3", ",", "64", ",", "par4", ",", "(", "par3", "+", "5", ")", "-", "1", ",", "74", ",", "(", "par4", "+", "5", ")", "-", "1", ")", ";", "break", ";", "}", "}", "public", "ComponentStrongholdStairs", "(", "int", "par1", ",", "Random", "par2Random", ",", "StructureBoundingBox", "par3StructureBoundingBox", ",", "int", "par4", ")", "{", "super", "(", "par1", ")", ";", "field_35327_a", "=", "false", ";", "coordBaseMode", "=", "par4", ";", "doorType", "=", "getRandomDoor", "(", "par2Random", ")", ";", "boundingBox", "=", "par3StructureBoundingBox", ";", "}", "public", "void", "buildComponent", "(", "StructureComponent", "par1StructureComponent", ",", "List", "par2List", ",", "Random", "par3Random", ")", "{", "if", "(", "field_35327_a", ")", "{", "StructureStrongholdPieces", ".", "setComponentType", "(", "net", ".", "minecraft", ".", "src", ".", "ComponentStrongholdCrossing", ".", "class", ")", ";", "}", "getNextComponentNormal", "(", "(", "ComponentStrongholdStairs2", ")", "par1StructureComponent", ",", "par2List", ",", "par3Random", ",", "1", ",", "1", ")", ";", "}", "public", "static", "ComponentStrongholdStairs", "getStrongholdStairsComponent", "(", "List", "par0List", ",", "Random", "par1Random", ",", "int", "par2", ",", "int", "par3", ",", "int", "par4", ",", "int", "par5", ",", "int", "par6", ")", "{", "StructureBoundingBox", "structureboundingbox", "=", "StructureBoundingBox", ".", "getComponentToAddBoundingBox", "(", "par2", ",", "par3", ",", "par4", ",", "-", "1", ",", "-", "7", ",", "0", ",", "5", ",", "11", ",", "5", ",", "par5", ")", ";", "if", "(", "!", "canStrongholdGoDeeper", "(", "structureboundingbox", ")", "||", "StructureComponent", ".", "findIntersecting", "(", "par0List", ",", "structureboundingbox", ")", "!=", "null", ")", "{", "return", "null", ";", "}", "else", "{", "return", "new", "ComponentStrongholdStairs", "(", "par6", ",", "par1Random", ",", "structureboundingbox", ",", "par5", ")", ";", "}", "}", "public", "boolean", "addComponentParts", "(", "World", "par1World", ",", "Random", "par2Random", ",", "StructureBoundingBox", "par3StructureBoundingBox", ")", "{", "if", "(", "isLiquidInStructureBoundingBox", "(", "par1World", ",", "par3StructureBoundingBox", ")", ")", "{", "return", "false", ";", "}", "else", "{", "if", "(", "!", "field_35327_a", ")", ";", "fillWithRandomizedBlocks", "(", "par1World", ",", "par3StructureBoundingBox", ",", "0", ",", "0", ",", "0", ",", "4", ",", "10", ",", "4", ",", "true", ",", "par2Random", ",", "StructureStrongholdPieces", ".", "getStrongholdStones", "(", ")", ")", ";", "placeDoor", "(", "par1World", ",", "par2Random", ",", "par3StructureBoundingBox", ",", "doorType", ",", "1", ",", "7", ",", "0", ")", ";", "placeDoor", "(", "par1World", ",", "par2Random", ",", "par3StructureBoundingBox", ",", "EnumDoor", ".", "OPENING", ",", "1", ",", "1", ",", "4", ")", ";", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "stoneBrick", ".", "blockID", ",", "0", ",", "2", ",", "6", ",", "1", ",", "par3StructureBoundingBox", ")", ";", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "stoneBrick", ".", "blockID", ",", "0", ",", "1", ",", "5", ",", "1", ",", "par3StructureBoundingBox", ")", ";", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "stairSingle", ".", "blockID", ",", "0", ",", "1", ",", "6", ",", "1", ",", "par3StructureBoundingBox", ")", ";", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "stoneBrick", ".", "blockID", ",", "0", ",", "1", ",", "5", ",", "2", ",", "par3StructureBoundingBox", ")", ";", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "stoneBrick", ".", "blockID", ",", "0", ",", "1", ",", "4", ",", "3", ",", "par3StructureBoundingBox", ")", ";", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "stairSingle", ".", "blockID", ",", "0", ",", "1", ",", "5", ",", "3", ",", "par3StructureBoundingBox", ")", ";", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "stoneBrick", ".", "blockID", ",", "0", ",", "2", ",", "4", ",", "3", ",", "par3StructureBoundingBox", ")", ";", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "stoneBrick", ".", "blockID", ",", "0", ",", "3", ",", "3", ",", "3", ",", "par3StructureBoundingBox", ")", ";", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "stairSingle", ".", "blockID", ",", "0", ",", "3", ",", "4", ",", "3", ",", "par3StructureBoundingBox", ")", ";", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "stoneBrick", ".", "blockID", ",", "0", ",", "3", ",", "3", ",", "2", ",", "par3StructureBoundingBox", ")", ";", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "stoneBrick", ".", "blockID", ",", "0", ",", "3", ",", "2", ",", "1", ",", "par3StructureBoundingBox", ")", ";", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "stairSingle", ".", "blockID", ",", "0", ",", "3", ",", "3", ",", "1", ",", "par3StructureBoundingBox", ")", ";", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "stoneBrick", ".", "blockID", ",", "0", ",", "2", ",", "2", ",", "1", ",", "par3StructureBoundingBox", ")", ";", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "stoneBrick", ".", "blockID", ",", "0", ",", "1", ",", "1", ",", "1", ",", "par3StructureBoundingBox", ")", ";", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "stairSingle", ".", "blockID", ",", "0", ",", "1", ",", "2", ",", "1", ",", "par3StructureBoundingBox", ")", ";", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "stoneBrick", ".", "blockID", ",", "0", ",", "1", ",", "1", ",", "2", ",", "par3StructureBoundingBox", ")", ";", "placeBlockAtCurrentPosition", "(", "par1World", ",", "Block", ".", "stairSingle", ".", "blockID", ",", "0", ",", "1", ",", "1", ",", "3", ",", "par3StructureBoundingBox", ")", ";", "return", "true", ";", "}", "}", "}", "</s>" ]
9,968
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "io", ".", "*", ";", "public", "class", "Packet103SetSlot", "extends", "Packet", "{", "public", "int", "windowId", ";", "public", "int", "itemSlot", ";", "public", "ItemStack", "myItemStack", ";", "public", "Packet103SetSlot", "(", ")", "{", "}", "public", "Packet103SetSlot", "(", "int", "par1", ",", "int", "par2", ",", "ItemStack", "par3ItemStack", ")", "{", "windowId", "=", "par1", ";", "itemSlot", "=", "par2", ";", "myItemStack", "=", "par3ItemStack", "!=", "null", "?", "par3ItemStack", ".", "copy", "(", ")", ":", "par3ItemStack", ";", "}", "public", "void", "processPacket", "(", "NetHandler", "par1NetHandler", ")", "{", "par1NetHandler", ".", "handleSetSlot", "(", "this", ")", ";", "}", "public", "void", "readPacketData", "(", "DataInputStream", "par1DataInputStream", ")", "throws", "IOException", "{", "windowId", "=", "par1DataInputStream", ".", "readByte", "(", ")", ";", "itemSlot", "=", "par1DataInputStream", ".", "readShort", "(", ")", ";", "myItemStack", "=", "readItemStack", "(", "par1DataInputStream", ")", ";", "}", "public", "void", "writePacketData", "(", "DataOutputStream", "par1DataOutputStream", ")", "throws", "IOException", "{", "par1DataOutputStream", ".", "writeByte", "(", "windowId", ")", ";", "par1DataOutputStream", ".", "writeShort", "(", "itemSlot", ")", ";", "writeItemStack", "(", "myItemStack", ",", "par1DataOutputStream", ")", ";", "}", "public", "int", "getPacketSize", "(", ")", "{", "return", "8", ";", "}", "}", "</s>" ]
9,969
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "import", "java", ".", "io", ".", "*", ";", "public", "class", "Packet21PickupSpawn", "extends", "Packet", "{", "public", "int", "entityId", ";", "public", "int", "xPosition", ";", "public", "int", "yPosition", ";", "public", "int", "zPosition", ";", "public", "byte", "rotation", ";", "public", "byte", "pitch", ";", "public", "byte", "roll", ";", "public", "int", "itemID", ";", "public", "int", "count", ";", "public", "int", "itemDamage", ";", "public", "Packet21PickupSpawn", "(", ")", "{", "}", "public", "Packet21PickupSpawn", "(", "EntityItem", "par1EntityItem", ")", "{", "entityId", "=", "par1EntityItem", ".", "entityId", ";", "itemID", "=", "par1EntityItem", ".", "item", ".", "itemID", ";", "count", "=", "par1EntityItem", ".", "item", ".", "stackSize", ";", "itemDamage", "=", "par1EntityItem", ".", "item", ".", "getItemDamage", "(", ")", ";", "xPosition", "=", "MathHelper", ".", "floor_double", "(", "par1EntityItem", ".", "posX", "*", "32D", ")", ";", "yPosition", "=", "MathHelper", ".", "floor_double", "(", "par1EntityItem", ".", "posY", "*", "32D", ")", ";", "zPosition", "=", "MathHelper", ".", "floor_double", "(", "par1EntityItem", ".", "posZ", "*", "32D", ")", ";", "rotation", "=", "(", "byte", ")", "(", "int", ")", "(", "par1EntityItem", ".", "motionX", "*", "128D", ")", ";", "pitch", "=", "(", "byte", ")", "(", "int", ")", "(", "par1EntityItem", ".", "motionY", "*", "128D", ")", ";", "roll", "=", "(", "byte", ")", "(", "int", ")", "(", "par1EntityItem", ".", "motionZ", "*", "128D", ")", ";", "}", "public", "void", "readPacketData", "(", "DataInputStream", "par1DataInputStream", ")", "throws", "IOException", "{", "entityId", "=", "par1DataInputStream", ".", "readInt", "(", ")", ";", "itemID", "=", "par1DataInputStream", ".", "readShort", "(", ")", ";", "count", "=", "par1DataInputStream", ".", "readByte", "(", ")", ";", "itemDamage", "=", "par1DataInputStream", ".", "readShort", "(", ")", ";", "xPosition", "=", "par1DataInputStream", ".", "readInt", "(", ")", ";", "yPosition", "=", "par1DataInputStream", ".", "readInt", "(", ")", ";", "zPosition", "=", "par1DataInputStream", ".", "readInt", "(", ")", ";", "rotation", "=", "par1DataInputStream", ".", "readByte", "(", ")", ";", "pitch", "=", "par1DataInputStream", ".", "readByte", "(", ")", ";", "roll", "=", "par1DataInputStream", ".", "readByte", "(", ")", ";", "}", "public", "void", "writePacketData", "(", "DataOutputStream", "par1DataOutputStream", ")", "throws", "IOException", "{", "par1DataOutputStream", ".", "writeInt", "(", "entityId", ")", ";", "par1DataOutputStream", ".", "writeShort", "(", "itemID", ")", ";", "par1DataOutputStream", ".", "writeByte", "(", "count", ")", ";", "par1DataOutputStream", ".", "writeShort", "(", "itemDamage", ")", ";", "par1DataOutputStream", ".", "writeInt", "(", "xPosition", ")", ";", "par1DataOutputStream", ".", "writeInt", "(", "yPosition", ")", ";", "par1DataOutputStream", ".", "writeInt", "(", "zPosition", ")", ";", "par1DataOutputStream", ".", "writeByte", "(", "rotation", ")", ";", "par1DataOutputStream", ".", "writeByte", "(", "pitch", ")", ";", "par1DataOutputStream", ".", "writeByte", "(", "roll", ")", ";", "}", "public", "void", "processPacket", "(", "NetHandler", "par1NetHandler", ")", "{", "par1NetHandler", ".", "handlePickupSpawn", "(", "this", ")", ";", "}", "public", "int", "getPacketSize", "(", ")", "{", "return", "24", ";", "}", "}", "</s>" ]
9,970
[ "<s>", "package", "net", ".", "minecraft", ".", "src", ";", "public", "class", "EntitySmallFireball", "extends", "EntityFireball", "{", "public", "EntitySmallFireball", "(", "World", "par1World", ")", "{", "super", "(", "par1World", ")", ";", "setSize", "(", "0.3125F", ",", "0.3125F", ")", ";", "}", "public", "EntitySmallFireball", "(", "World", "par1World", ",", "EntityLiving", "par2EntityLiving", ",", "double", "par3", ",", "double", "par5", ",", "double", "par7", ")", "{", "super", "(", "par1World", ",", "par2EntityLiving", ",", "par3", ",", "par5", ",", "par7", ")", ";", "setSize", "(", "0.3125F", ",", "0.3125F", ")", ";", "}", "public", "EntitySmallFireball", "(", "World", "par1World", ",", "double", "par2", ",", "double", "par4", ",", "double", "par6", ",", "double", "par8", ",", "double", "par10", ",", "double", "par12", ")", "{", "super", "(", "par1World", ",", "par2", ",", "par4", ",", "par6", ",", "par8", ",", "par10", ",", "par12", ")", ";", "setSize", "(", "0.3125F", ",", "0.3125F", ")", ";", "}", "protected", "void", "func_40063_a", "(", "MovingObjectPosition", "par1MovingObjectPosition", ")", "{", "if", "(", "!", "worldObj", ".", "isRemote", ")", "{", "if", "(", "par1MovingObjectPosition", ".", "entityHit", "!=", "null", ")", "{", "if", "(", "!", "par1MovingObjectPosition", ".", "entityHit", ".", "isImmuneToFire", "(", ")", "&&", "par1MovingObjectPosition", ".", "entityHit", ".", "attackEntityFrom", "(", "DamageSource", ".", "causeFireballDamage", "(", "this", ",", "shootingEntity", ")", ",", "5", ")", ")", "{", "par1MovingObjectPosition", ".", "entityHit", ".", "setFire", "(", "5", ")", ";", "}", "}", "else", "{", "int", "i", "=", "par1MovingObjectPosition", ".", "blockX", ";", "int", "j", "=", "par1MovingObjectPosition", ".", "blockY", ";", "int", "k", "=", "par1MovingObjectPosition", ".", "blockZ", ";", "switch", "(", "par1MovingObjectPosition", ".", "sideHit", ")", "{", "case", "1", ":", "j", "++", ";", "break", ";", "case", "0", ":", "j", "--", ";", "break", ";", "case", "2", ":", "k", "--", ";", "break", ";", "case", "3", ":", "k", "++", ";", "break", ";", "case", "5", ":", "i", "++", ";", "break", ";", "case", "4", ":", "i", "--", ";", "break", ";", "}", "if", "(", "worldObj", ".", "isAirBlock", "(", "i", ",", "j", ",", "k", ")", ")", "{", "worldObj", ".", "setBlockWithNotify", "(", "i", ",", "j", ",", "k", ",", "Block", ".", "fire", ".", "blockID", ")", ";", "}", "}", "setDead", "(", ")", ";", "}", "}", "public", "boolean", "canBeCollidedWith", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "attackEntityFrom", "(", "DamageSource", "par1DamageSource", ",", "int", "par2", ")", "{", "return", "false", ";", "}", "}", "</s>" ]
9,971
[ "<s>", "package", "at", ".", "droidcode", ".", "commands", ";", "import", "android", ".", "graphics", ".", "Canvas", ";", "import", "android", ".", "graphics", ".", "Paint", ";", "import", "android", ".", "graphics", ".", "Path", ";", "import", "android", ".", "graphics", ".", "Point", ";", "public", "class", "Command", "implements", "Runnable", "{", "private", "Canvas", "cmdCanvas", ";", "private", "final", "Paint", "cmdPaint", ";", "private", "final", "Path", "cmdPath", ";", "private", "final", "Point", "cmdPoint", ";", "public", "Command", "(", "Paint", "paint", ",", "Path", "path", ")", "{", "cmdPaint", "=", "new", "Paint", "(", "paint", ")", ";", "cmdPath", "=", "new", "Path", "(", "path", ")", ";", "cmdPoint", "=", "null", ";", "}", "public", "Command", "(", "Paint", "paint", ",", "Point", "point", ")", "{", "cmdPaint", "=", "new", "Paint", "(", "paint", ")", ";", "cmdPath", "=", "null", ";", "cmdPoint", "=", "new", "Point", "(", "point", ")", ";", "}", "public", "Command", "(", "Paint", "paint", ")", "{", "cmdPaint", "=", "new", "Paint", "(", "paint", ")", ";", "cmdPath", "=", "null", ";", "cmdPoint", "=", "null", ";", "}", "void", "setCanvas", "(", "Canvas", "canvas", ")", "{", "cmdCanvas", "=", "canvas", ";", "}", "@", "Override", "public", "void", "run", "(", ")", "{", "if", "(", "cmdPath", "!=", "null", ")", "{", "cmdCanvas", ".", "drawPath", "(", "cmdPath", ",", "cmdPaint", ")", ";", "}", "else", "if", "(", "cmdPoint", "!=", "null", ")", "{", "cmdCanvas", ".", "drawPoint", "(", "cmdPoint", ".", "x", ",", "cmdPoint", ".", "y", ",", "cmdPaint", ")", ";", "}", "else", "{", "cmdCanvas", ".", "drawPaint", "(", "cmdPaint", ")", ";", "}", "}", "}", "</s>" ]
9,972
[ "<s>", "package", "at", ".", "droidcode", ".", "commands", ";", "import", "java", ".", "util", ".", "LinkedList", ";", "import", "android", ".", "graphics", ".", "Bitmap", ";", "import", "android", ".", "graphics", ".", "Bitmap", ".", "Config", ";", "import", "android", ".", "graphics", ".", "Canvas", ";", "import", "android", ".", "graphics", ".", "Color", ";", "import", "android", ".", "graphics", ".", "Paint", ";", "import", "android", ".", "graphics", ".", "PorterDuff", ";", "import", "android", ".", "graphics", ".", "PorterDuffXfermode", ";", "public", "class", "CommandManager", "{", "private", "static", "final", "int", "MAXCOMMANDS", "=", "256", ";", "private", "Bitmap", "originalBitmap", ";", "private", "int", "commandIndex", ";", "private", "final", "Canvas", "bitmapCanvas", ";", "private", "final", "Paint", "transparencyPaint", ";", "private", "final", "LinkedList", "<", "Command", ">", "commandStack", ";", "public", "CommandManager", "(", ")", "{", "commandIndex", "=", "0", ";", "commandStack", "=", "new", "LinkedList", "<", "Command", ">", "(", ")", ";", "bitmapCanvas", "=", "new", "Canvas", "(", ")", ";", "transparencyPaint", "=", "new", "Paint", "(", ")", ";", "transparencyPaint", ".", "setColor", "(", "Color", ".", "TRANSPARENT", ")", ";", "transparencyPaint", ".", "setXfermode", "(", "new", "PorterDuffXfermode", "(", "PorterDuff", ".", "Mode", ".", "CLEAR", ")", ")", ";", "}", "public", "void", "clear", "(", ")", "{", "if", "(", "originalBitmap", "!=", "null", ")", "{", "originalBitmap", ".", "recycle", "(", ")", ";", "originalBitmap", "=", "null", ";", "}", "commandStack", ".", "clear", "(", ")", ";", "commandIndex", "=", "0", ";", "}", "public", "void", "reset", "(", "Bitmap", "originalBitmap", ")", "{", "if", "(", "this", ".", "originalBitmap", "!=", "null", ")", "{", "this", ".", "originalBitmap", ".", "recycle", "(", ")", ";", "commandStack", ".", "clear", "(", ")", ";", "commandIndex", "=", "0", ";", "}", "this", ".", "originalBitmap", "=", "originalBitmap", ".", "copy", "(", "Config", ".", "ARGB_8888", ",", "true", ")", ";", "bitmapCanvas", ".", "setBitmap", "(", "this", ".", "originalBitmap", ")", ";", "}", "public", "synchronized", "void", "commitCommand", "(", "Command", "command", ",", "Canvas", "canvas", ")", "{", "command", ".", "setCanvas", "(", "canvas", ")", ";", "command", ".", "run", "(", ")", ";", "if", "(", "commandIndex", "<", "commandStack", ".", "size", "(", ")", ")", "{", "for", "(", "int", "i", "=", "commandStack", ".", "size", "(", ")", ";", "i", ">", "commandIndex", ";", "i", "--", ")", "{", "commandStack", ".", "removeLast", "(", ")", ";", "}", "}", "if", "(", "commandIndex", "==", "MAXCOMMANDS", ")", "{", "Command", "removed", "=", "commandStack", ".", "removeFirst", "(", ")", ";", "removed", ".", "setCanvas", "(", "bitmapCanvas", ")", ";", "removed", ".", "run", "(", ")", ";", "}", "else", "{", "commandIndex", "++", ";", "}", "commandStack", ".", "add", "(", "command", ")", ";", "}", "public", "synchronized", "void", "undoLast", "(", "Canvas", "canvas", ")", "{", "if", "(", "commandIndex", ">", "0", ")", "{", "canvas", ".", "drawPaint", "(", "transparencyPaint", ")", ";", "canvas", ".", "drawBitmap", "(", "originalBitmap", ",", "0", ",", "0", ",", "null", ")", ";", "commandIndex", "--", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "commandIndex", ";", "i", "++", ")", "{", "Command", "command", "=", "commandStack", ".", "get", "(", "i", ")", ";", "command", ".", "run", "(", ")", ";", "}", "}", "}", "public", "synchronized", "void", "redoLast", "(", "Canvas", "canvas", ")", "{", "if", "(", "commandIndex", "<", "commandStack", ".", "size", "(", ")", ")", "{", "Command", "command", "=", "commandStack", ".", "get", "(", "commandIndex", ")", ";", "command", ".", "run", "(", ")", ";", "commandIndex", "++", ";", "}", "}", "}", "</s>" ]
9,973
[ "<s>", "package", "at", ".", "droidcode", ".", "threadpaint", ".", "api", ";", "import", "android", ".", "content", ".", "SharedPreferences", ";", "public", "interface", "PreferencesCallback", "{", "void", "preferenceChanged", "(", "SharedPreferences", "preferences", ",", "String", "key", ")", ";", "}", "</s>" ]
9,974
[ "<s>", "package", "at", ".", "droidcode", ".", "threadpaint", ".", "api", ";", "public", "interface", "ToolButtonAnimator", "{", "void", "fadeOutToolButtons", "(", ")", ";", "void", "fadeInToolButtons", "(", ")", ";", "}", "</s>" ]
9,975
[ "<s>", "package", "at", ".", "droidcode", ".", "threadpaint", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileInputStream", ";", "import", "java", ".", "io", ".", "FileNotFoundException", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "RandomAccessFile", ";", "import", "java", ".", "nio", ".", "MappedByteBuffer", ";", "import", "java", ".", "nio", ".", "channels", ".", "FileChannel", ";", "import", "java", ".", "nio", ".", "channels", ".", "FileChannel", ".", "MapMode", ";", "import", "android", ".", "app", ".", "Activity", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "pm", ".", "ActivityInfo", ";", "import", "android", ".", "content", ".", "res", ".", "Resources", ";", "import", "android", ".", "graphics", ".", "Bitmap", ";", "import", "android", ".", "graphics", ".", "BitmapFactory", ";", "import", "android", ".", "os", ".", "Environment", ";", "import", "android", ".", "util", ".", "Log", ";", "import", "android", ".", "util", ".", "TypedValue", ";", "import", "android", ".", "view", ".", "Display", ";", "import", "android", ".", "view", ".", "Surface", ";", "import", "android", ".", "view", ".", "WindowManager", ";", "import", "android", ".", "widget", ".", "Toast", ";", "public", "final", "class", "Utils", "{", "private", "Utils", "(", ")", "{", "}", "public", "static", "int", "dp2px", "(", "Context", "context", ",", "int", "dp", ")", "{", "final", "Resources", "res", "=", "context", ".", "getResources", "(", ")", ";", "float", "px", "=", "TypedValue", ".", "applyDimension", "(", "TypedValue", ".", "COMPLEX_UNIT_DIP", ",", "dp", ",", "res", ".", "getDisplayMetrics", "(", ")", ")", ";", "return", "Math", ".", "round", "(", "px", ")", ";", "}", "public", "static", "int", "sreenWidthPx", "(", "Context", "context", ",", "float", "percent", ")", "{", "return", "Math", ".", "round", "(", "context", ".", "getResources", "(", ")", ".", "getDisplayMetrics", "(", ")", ".", "widthPixels", "*", "percent", ")", ";", "}", "public", "static", "void", "lockScreenOrientation", "(", "boolean", "lock", ",", "Activity", "activity", ")", "{", "int", "screenOrientation", "=", "ActivityInfo", ".", "SCREEN_ORIENTATION_SENSOR", ";", "if", "(", "lock", ")", "{", "Display", "display", "=", "(", "(", "WindowManager", ")", "activity", ".", "getSystemService", "(", "Context", ".", "WINDOW_SERVICE", ")", ")", ".", "getDefaultDisplay", "(", ")", ";", "switch", "(", "display", ".", "getRotation", "(", ")", ")", "{", "case", "Surface", ".", "ROTATION_0", ":", "screenOrientation", "=", "ActivityInfo", ".", "SCREEN_ORIENTATION_PORTRAIT", ";", "break", ";", "case", "Surface", ".", "ROTATION_90", ":", "screenOrientation", "=", "ActivityInfo", ".", "SCREEN_ORIENTATION_LANDSCAPE", ";", "break", ";", "case", "Surface", ".", "ROTATION_270", ":", "screenOrientation", "=", "ActivityInfo", ".", "SCREEN_ORIENTATION_LANDSCAPE", ";", "break", ";", "}", "}", "activity", ".", "setRequestedOrientation", "(", "screenOrientation", ")", ";", "}", "public", "static", "Bitmap", "decodeFile", "(", "Context", "c", ",", "File", "f", ")", "{", "Bitmap", "tmpBitmap", "=", "null", ";", "try", "{", "BitmapFactory", ".", "Options", "o", "=", "new", "BitmapFactory", ".", "Options", "(", ")", ";", "o", ".", "inJustDecodeBounds", "=", "true", ";", "BitmapFactory", ".", "decodeStream", "(", "new", "FileInputStream", "(", "f", ")", ",", "null", ",", "o", ")", ";", "final", "int", "REQUIRED_SIZE", "=", "1024", ";", "int", "tmpWidth", "=", "o", ".", "outWidth", ",", "tmpHeight", "=", "o", ".", "outHeight", ";", "int", "scale", "=", "1", ";", "while", "(", "tmpWidth", "/", "2", ">", "REQUIRED_SIZE", "||", "tmpHeight", "/", "2", ">", "REQUIRED_SIZE", ")", "{", "tmpWidth", "/=", "2", ";", "tmpHeight", "/=", "2", ";", "scale", "*=", "2", ";", "}", "BitmapFactory", ".", "Options", "o2", "=", "new", "BitmapFactory", ".", "Options", "(", ")", ";", "o2", ".", "inSampleSize", "=", "scale", ";", "tmpBitmap", "=", "BitmapFactory", ".", "decodeStream", "(", "new", "FileInputStream", "(", "f", ")", ",", "null", ",", "o2", ")", ";", "File", "file", "=", "new", "File", "(", "c", ".", "getExternalFilesDir", "(", "Environment", ".", "DIRECTORY_PICTURES", ")", ",", "\"tmp\"", ")", ";", "file", ".", "getParentFile", "(", ")", ".", "mkdirs", "(", ")", ";", "RandomAccessFile", "randomAccessFile", "=", "new", "RandomAccessFile", "(", "file", ",", "\"rw\"", ")", ";", "int", "width", "=", "tmpBitmap", ".", "getWidth", "(", ")", ";", "int", "height", "=", "tmpBitmap", ".", "getHeight", "(", ")", ";", "FileChannel", "channel", "=", "randomAccessFile", ".", "getChannel", "(", ")", ";", "MappedByteBuffer", "map", "=", "channel", ".", "map", "(", "MapMode", ".", "READ_WRITE", ",", "0", ",", "width", "*", "height", "*", "4", ")", ";", "tmpBitmap", ".", "copyPixelsToBuffer", "(", "map", ")", ";", "tmpBitmap", ".", "recycle", "(", ")", ";", "tmpBitmap", "=", "Bitmap", ".", "createBitmap", "(", "width", ",", "height", ",", "Bitmap", ".", "Config", ".", "ARGB_8888", ")", ";", "map", ".", "position", "(", "0", ")", ";", "tmpBitmap", ".", "copyPixelsFromBuffer", "(", "map", ")", ";", "channel", ".", "close", "(", ")", ";", "randomAccessFile", ".", "close", "(", ")", ";", "file", ".", "delete", "(", ")", ";", "}", "catch", "(", "FileNotFoundException", "e", ")", "{", "Log", ".", "e", "(", "TpApplication", ".", "TAG", ",", "\"ERROR", "\"", ",", "e", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "Log", ".", "e", "(", "TpApplication", ".", "TAG", ",", "\"ERROR", "\"", ",", "e", ")", ";", "}", "return", "tmpBitmap", ";", "}", "public", "static", "class", "ToastRunnable", "implements", "Runnable", "{", "private", "final", "Context", "context", ";", "private", "final", "String", "text", ";", "public", "ToastRunnable", "(", "Context", "c", ",", "String", "message", ")", "{", "context", "=", "c", ";", "text", "=", "message", ";", "}", "@", "Override", "public", "void", "run", "(", ")", "{", "Toast", ".", "makeText", "(", "context", ",", "text", ",", "Toast", ".", "LENGTH_SHORT", ")", ".", "show", "(", ")", ";", "}", "}", "}", "</s>" ]
9,976
[ "<s>", "package", "at", ".", "droidcode", ".", "threadpaint", ";", "import", "static", "at", ".", "droidcode", ".", "threadpaint", ".", "TpApplication", ".", "TAG", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "List", ";", "import", "android", ".", "app", ".", "Activity", ";", "import", "android", ".", "app", ".", "ProgressDialog", ";", "import", "android", ".", "content", ".", "Intent", ";", "import", "android", ".", "content", ".", "SharedPreferences", ";", "import", "android", ".", "database", ".", "Cursor", ";", "import", "android", ".", "graphics", ".", "Bitmap", ";", "import", "android", ".", "graphics", ".", "Color", ";", "import", "android", ".", "net", ".", "Uri", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "provider", ".", "MediaStore", ";", "import", "android", ".", "util", ".", "Log", ";", "import", "android", ".", "view", ".", "Menu", ";", "import", "android", ".", "view", ".", "MenuInflater", ";", "import", "android", ".", "view", ".", "MenuItem", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "view", ".", "animation", ".", "Animation", ";", "import", "android", ".", "view", ".", "animation", ".", "AnimationUtils", ";", "import", "android", ".", "widget", ".", "Button", ";", "import", "android", ".", "widget", ".", "Toast", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "TpPreferencesActivity", ".", "Preference", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "api", ".", "PreferencesCallback", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "api", ".", "ToolButtonAnimator", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "dialog", ".", "BrushPickerDialog", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "dialog", ".", "ColorPickerDialog", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "dialog", ".", "SaveFileDialog", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "ui", ".", "PaintView", ";", "public", "class", "TpMainActivity", "extends", "Activity", "implements", "ToolButtonAnimator", ",", "PreferencesCallback", "{", "public", "static", "Activity", "instance", ";", "private", "static", "final", "int", "REQ_LOAD", "=", "1", ";", "private", "PaintView", "paintView", ";", "private", "List", "<", "View", ">", "toolButtons", ";", "private", "ColorPickerDialog", "colorPickerDialog", ";", "private", "BrushPickerDialog", "brushPickerDialog", ";", "private", "Button", "buttonColor", ";", "private", "Button", "buttonBrush", ";", "private", "Button", "buttonMove", ";", "private", "Button", "buttonFill", ";", "private", "Button", "buttonErase", ";", "private", "Button", "buttonUndo", ";", "private", "Button", "buttonRedo", ";", "@", "Override", "public", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "setContentView", "(", "R", ".", "layout", ".", "activity_threadpaint", ")", ";", "instance", "=", "this", ";", "paintView", "=", "(", "PaintView", ")", "findViewById", "(", "R", ".", "id", ".", "view_paint_view", ")", ";", "paintView", ".", "setToolButtonAnimator", "(", "this", ")", ";", "buttonColor", "=", "(", "Button", ")", "findViewById", "(", "R", ".", "id", ".", "btn_tool_color", ")", ";", "buttonBrush", "=", "(", "Button", ")", "findViewById", "(", "R", ".", "id", ".", "btn_tool_brush", ")", ";", "buttonMove", "=", "(", "Button", ")", "findViewById", "(", "R", ".", "id", ".", "btn_tool_move", ")", ";", "buttonFill", "=", "(", "Button", ")", "findViewById", "(", "R", ".", "id", ".", "btn_tool_fill", ")", ";", "buttonErase", "=", "(", "Button", ")", "findViewById", "(", "R", ".", "id", ".", "btn_tool_erase", ")", ";", "buttonUndo", "=", "(", "Button", ")", "findViewById", "(", "R", ".", "id", ".", "btn_tool_undo", ")", ";", "buttonRedo", "=", "(", "Button", ")", "findViewById", "(", "R", ".", "id", ".", "btn_tool_redo", ")", ";", "toolButtons", "=", "new", "ArrayList", "<", "View", ">", "(", ")", ";", "Collections", ".", "addAll", "(", "toolButtons", ",", "buttonColor", ",", "buttonBrush", ",", "buttonMove", ",", "buttonFill", ",", "buttonErase", ",", "buttonUndo", ",", "buttonRedo", ")", ";", "setSelectedBackground", "(", "buttonBrush", ")", ";", "TpPreferencesActivity", ".", "addCallbackForPreference", "(", "this", ",", "Preference", ".", "LOCKORIENTATION", ")", ";", "TpPreferencesActivity", ".", "addCallbackForPreference", "(", "this", ",", "Preference", ".", "MOVETHRESHOLD", ")", ";", "}", "@", "Override", "public", "void", "onDestroy", "(", ")", "{", "Log", ".", "w", "(", "TAG", ",", "\"\"", ")", ";", "TpPreferencesActivity", ".", "removeCallback", "(", "this", ")", ";", "paintView", ".", "stopPaintThread", "(", ")", ";", "super", ".", "onDestroy", "(", ")", ";", "}", "@", "Override", "protected", "void", "onSaveInstanceState", "(", "Bundle", "b", ")", "{", "Log", ".", "d", "(", "TAG", ",", "\"\"", ")", ";", "paintView", ".", "saveState", "(", "b", ")", ";", "}", "@", "Override", "protected", "void", "onRestoreInstanceState", "(", "Bundle", "b", ")", "{", "Log", ".", "d", "(", "TAG", ",", "\"\"", ")", ";", "paintView", ".", "restoreState", "(", "b", ")", ";", "}", "@", "Override", "public", "boolean", "onCreateOptionsMenu", "(", "Menu", "menu", ")", "{", "MenuInflater", "inflater", "=", "getMenuInflater", "(", ")", ";", "inflater", ".", "inflate", "(", "R", ".", "menu", ".", "menu", ",", "menu", ")", ";", "return", "true", ";", "}", "@", "Override", "public", "boolean", "onOptionsItemSelected", "(", "MenuItem", "item", ")", "{", "switch", "(", "item", ".", "getItemId", "(", ")", ")", "{", "case", "R", ".", "id", ".", "menu_save", ":", "showSaveDialog", "(", ")", ";", "return", "true", ";", "case", "R", ".", "id", ".", "menu_load", ":", "Intent", "intent", "=", "new", "Intent", "(", "Intent", ".", "ACTION_GET_CONTENT", ")", ";", "intent", ".", "setType", "(", "\"image/*\"", ")", ";", "startActivityForResult", "(", "intent", ",", "REQ_LOAD", ")", ";", "return", "true", ";", "case", "R", ".", "id", ".", "menu_clear", ":", "paintView", ".", "resetCanvas", "(", ")", ";", "return", "true", ";", "case", "R", ".", "id", ".", "menu_prefs", ":", "Intent", "i", "=", "new", "Intent", "(", "this", ",", "TpPreferencesActivity", ".", "class", ")", ";", "startActivity", "(", "i", ")", ";", "return", "true", ";", "default", ":", "return", "super", ".", "onOptionsItemSelected", "(", "item", ")", ";", "}", "}", "public", "void", "onToolButtonClicked", "(", "View", "button", ")", "{", "switch", "(", "button", ".", "getId", "(", ")", ")", "{", "case", "R", ".", "id", ".", "btn_tool_color", ":", "showColorPickerDialog", "(", ")", ";", "break", ";", "case", "R", ".", "id", ".", "btn_tool_brush", ":", "if", "(", "paintView", ".", "selectedTool", "(", ")", "==", "PaintView", ".", "Tool", ".", "BRUSH", ")", "{", "showBrushPickerDialog", "(", ")", ";", "}", "else", "{", "paintView", ".", "selectTool", "(", "PaintView", ".", "Tool", ".", "BRUSH", ")", ";", "setSelectedBackground", "(", "buttonBrush", ")", ";", "}", "break", ";", "case", "R", ".", "id", ".", "btn_tool_move", ":", "paintView", ".", "selectTool", "(", "PaintView", ".", "Tool", ".", "MOVE", ")", ";", "setSelectedBackground", "(", "buttonMove", ")", ";", "break", ";", "case", "R", ".", "id", ".", "btn_tool_fill", ":", "paintView", ".", "fillWithPaint", "(", ")", ";", "break", ";", "case", "R", ".", "id", ".", "btn_tool_erase", ":", "paintView", ".", "selectTool", "(", "PaintView", ".", "Tool", ".", "ERASE", ")", ";", "paintView", ".", "setPaintColor", "(", "Color", ".", "TRANSPARENT", ")", ";", "setSelectedBackground", "(", "buttonErase", ")", ";", "break", ";", "case", "R", ".", "id", ".", "btn_tool_undo", ":", "paintView", ".", "undo", "(", ")", ";", "break", ";", "case", "R", ".", "id", ".", "btn_tool_redo", ":", "paintView", ".", "redo", "(", ")", ";", "break", ";", "}", "}", "private", "void", "setSelectedBackground", "(", "Button", "button", ")", "{", "buttonColor", ".", "setBackgroundResource", "(", "R", ".", "drawable", ".", "button_tool_color", ")", ";", "buttonBrush", ".", "setBackgroundResource", "(", "R", ".", "drawable", ".", "button_tool_brush", ")", ";", "buttonMove", ".", "setBackgroundResource", "(", "R", ".", "drawable", ".", "button_tool_move", ")", ";", "buttonFill", ".", "setBackgroundResource", "(", "R", ".", "drawable", ".", "button_tool_fill", ")", ";", "buttonErase", ".", "setBackgroundResource", "(", "R", ".", "drawable", ".", "button_tool_erase", ")", ";", "switch", "(", "button", ".", "getId", "(", ")", ")", "{", "case", "R", ".", "id", ".", "btn_tool_color", ":", "button", ".", "setBackgroundResource", "(", "R", ".", "drawable", ".", "button_tool_color_selected", ")", ";", "break", ";", "case", "R", ".", "id", ".", "btn_tool_brush", ":", "button", ".", "setBackgroundResource", "(", "R", ".", "drawable", ".", "button_tool_brush_selected", ")", ";", "break", ";", "case", "R", ".", "id", ".", "btn_tool_move", ":", "button", ".", "setBackgroundResource", "(", "R", ".", "drawable", ".", "button_tool_move_selected", ")", ";", "break", ";", "case", "R", ".", "id", ".", "btn_tool_fill", ":", "button", ".", "setBackgroundResource", "(", "R", ".", "drawable", ".", "button_tool_fill_selected", ")", ";", "break", ";", "case", "R", ".", "id", ".", "btn_tool_erase", ":", "button", ".", "setBackgroundResource", "(", "R", ".", "drawable", ".", "button_tool_erase_selected", ")", ";", "break", ";", "}", "}", "@", "Override", "public", "void", "onActivityResult", "(", "int", "requestCode", ",", "int", "resultCode", ",", "Intent", "data", ")", "{", "switch", "(", "requestCode", ")", "{", "case", "REQ_LOAD", ":", "if", "(", "resultCode", "==", "RESULT_OK", ")", "{", "Uri", "imageUri", "=", "data", ".", "getData", "(", ")", ";", "String", "[", "]", "filePathColumn", "=", "{", "MediaStore", ".", "Images", ".", "Media", ".", "DATA", "}", ";", "Cursor", "cursor", "=", "getContentResolver", "(", ")", ".", "query", "(", "imageUri", ",", "filePathColumn", ",", "null", ",", "null", ",", "null", ")", ";", "cursor", ".", "moveToFirst", "(", ")", ";", "int", "columnIndex", "=", "cursor", ".", "getColumnIndex", "(", "filePathColumn", "[", "0", "]", ")", ";", "final", "File", "imageFile", "=", "new", "File", "(", "cursor", ".", "getString", "(", "columnIndex", ")", ")", ";", "cursor", ".", "close", "(", ")", ";", "String", "loadMessge", "=", "getResources", "(", ")", ".", "getString", "(", "R", ".", "string", ".", "dialog_load", ")", ";", "final", "ProgressDialog", "load", "=", "ProgressDialog", ".", "show", "(", "TpMainActivity", ".", "this", ",", "\"\"", ",", "loadMessge", ",", "true", ")", ";", "Thread", "thread", "=", "new", "Thread", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "Bitmap", "bitmap", "=", "Utils", ".", "decodeFile", "(", "TpMainActivity", ".", "this", ",", "imageFile", ")", ";", "paintView", ".", "setBitmap", "(", "bitmap", ")", ";", "load", ".", "dismiss", "(", ")", ";", "}", "}", ";", "thread", ".", "start", "(", ")", ";", "}", "break", ";", "}", "}", "@", "Override", "public", "void", "fadeOutToolButtons", "(", ")", "{", "Animation", "fadeOut", "=", "AnimationUtils", ".", "loadAnimation", "(", "this", ",", "R", ".", "anim", ".", "alpha_out", ")", ";", "animateViews", "(", "toolButtons", ",", "fadeOut", ")", ";", "}", "@", "Override", "public", "void", "fadeInToolButtons", "(", ")", "{", "Animation", "fadeIn", "=", "AnimationUtils", ".", "loadAnimation", "(", "this", ",", "R", ".", "anim", ".", "alpha_in", ")", ";", "animateViews", "(", "toolButtons", ",", "fadeIn", ")", ";", "}", "private", "void", "animateViews", "(", "List", "<", "View", ">", "views", ",", "Animation", "a", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "views", ".", "size", "(", ")", ";", "i", "++", ")", "{", "a", ".", "reset", "(", ")", ";", "views", ".", "get", "(", "i", ")", ".", "clearAnimation", "(", ")", ";", "views", ".", "get", "(", "i", ")", ".", "startAnimation", "(", "a", ")", ";", "}", "}", "private", "void", "showColorPickerDialog", "(", ")", "{", "if", "(", "colorPickerDialog", "==", "null", ")", "{", "colorPickerDialog", "=", "new", "ColorPickerDialog", "(", "this", ",", "paintView", ")", ";", "}", "colorPickerDialog", ".", "show", "(", ")", ";", "}", "private", "void", "showBrushPickerDialog", "(", ")", "{", "if", "(", "brushPickerDialog", "==", "null", ")", "{", "brushPickerDialog", "=", "new", "BrushPickerDialog", "(", "this", ",", "paintView", ")", ";", "}", "brushPickerDialog", ".", "show", "(", ")", ";", "}", "private", "void", "showSaveDialog", "(", ")", "{", "final", "SaveFileDialog", "dialog", "=", "new", "SaveFileDialog", "(", "this", ",", "paintView", ".", "getBitmap", "(", ")", ")", ";", "dialog", ".", "show", "(", ")", ";", "}", "@", "Override", "public", "void", "preferenceChanged", "(", "SharedPreferences", "preferences", ",", "String", "key", ")", "{", "if", "(", "key", ".", "equals", "(", "Preference", ".", "LOCKORIENTATION", ".", "key", "(", ")", ")", ")", "{", "boolean", "lock", "=", "preferences", ".", "getBoolean", "(", "key", ",", "true", ")", ";", "Log", ".", "d", "(", "TAG", ",", "\"\"", "+", "lock", ")", ";", "Utils", ".", "lockScreenOrientation", "(", "lock", ",", "this", ")", ";", "}", "else", "if", "(", "key", ".", "equals", "(", "Preference", ".", "MOVETHRESHOLD", ".", "key", "(", ")", ")", ")", "{", "float", "f", "=", "1.0f", ";", "try", "{", "f", "=", "Float", ".", "parseFloat", "(", "preferences", ".", "getString", "(", "key", ",", "\"1.0f\"", ")", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "Log", ".", "e", "(", "TAG", ",", "\"ERROR", "\"", ",", "e", ")", ";", "CharSequence", "text", "=", "getResources", "(", ")", ".", "getString", "(", "R", ".", "string", ".", "toast_float_parse_error", ")", ";", "Toast", ".", "makeText", "(", "this", ",", "text", ",", "Toast", ".", "LENGTH_SHORT", ")", ".", "show", "(", ")", ";", "}", "Log", ".", "d", "(", "TAG", ",", "\"\"", "+", "Float", ".", "toString", "(", "f", ")", ")", ";", "paintView", ".", "setMoveThreshold", "(", "f", ")", ";", "}", "}", "}", "</s>" ]
9,977
[ "<s>", "package", "at", ".", "droidcode", ".", "threadpaint", ";", "import", "android", ".", "app", ".", "Application", ";", "public", "class", "TpApplication", "extends", "Application", "{", "public", "static", "final", "String", "TAG", "=", "\"THREADPAINT\"", ";", "private", "static", "final", "int", "MAX_STROKE_WIDTH_DP", "=", "200", ";", "private", "int", "maxStrokeWidthPx", ";", "@", "Override", "public", "void", "onCreate", "(", ")", "{", "super", ".", "onCreate", "(", ")", ";", "maxStrokeWidthPx", "=", "Utils", ".", "dp2px", "(", "getApplicationContext", "(", ")", ",", "MAX_STROKE_WIDTH_DP", ")", ";", "}", "public", "int", "maxStrokeWidth", "(", ")", "{", "return", "maxStrokeWidthPx", ";", "}", "}", "</s>" ]
9,978
[ "<s>", "package", "at", ".", "droidcode", ".", "threadpaint", ".", "dialog", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "graphics", ".", "Bitmap", ";", "import", "android", ".", "graphics", ".", "BitmapFactory", ";", "import", "android", ".", "graphics", ".", "BitmapShader", ";", "import", "android", ".", "graphics", ".", "Canvas", ";", "import", "android", ".", "graphics", ".", "Paint", ";", "import", "android", ".", "graphics", ".", "Paint", ".", "Style", ";", "import", "android", ".", "graphics", ".", "RectF", ";", "import", "android", ".", "graphics", ".", "Shader", ";", "import", "android", ".", "util", ".", "AttributeSet", ";", "import", "android", ".", "view", ".", "MotionEvent", ";", "import", "android", ".", "view", ".", "View", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "R", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "Utils", ";", "public", "abstract", "class", "ShapeView", "extends", "View", "{", "interface", "ShapeClickedListener", "{", "void", "onShapeClicked", "(", ")", ";", "}", "private", "final", "int", "centerX", ";", "private", "float", "shapeDiameter", ";", "private", "float", "shapeRadius", ";", "private", "final", "RectF", "rectFullInset", ";", "private", "final", "RectF", "rectFull", ";", "private", "final", "RectF", "rectFrame", ";", "private", "final", "Paint", "shapePaint", ";", "private", "final", "Paint", "framePaint", ";", "private", "final", "Paint", "checkeredPattern", ";", "private", "Shape", "shape", ";", "private", "boolean", "trackingCenter", ";", "private", "boolean", "highlightCenter", ";", "private", "final", "int", "indicatorFrameWidth", ";", "private", "ShapeClickedListener", "shapeClickedListener", ";", "enum", "Shape", "{", "CIRCLE", ",", "RECT", "}", ";", "protected", "ShapeView", "(", "Context", "c", ",", "AttributeSet", "attrs", ")", "{", "super", "(", "c", ",", "attrs", ")", ";", "shape", "=", "Shape", ".", "CIRCLE", ";", "shapeDiameter", "=", "Utils", ".", "dp2px", "(", "c", ",", "100", ")", ";", "shapeRadius", "=", "shapeDiameter", "/", "2f", ";", "centerX", "=", "Utils", ".", "sreenWidthPx", "(", "c", ",", "0.75f", ")", "/", "2", ";", "indicatorFrameWidth", "=", "Utils", ".", "dp2px", "(", "c", ",", "5", ")", ";", "shapePaint", "=", "new", "Paint", "(", "Paint", ".", "ANTI_ALIAS_FLAG", ")", ";", "framePaint", "=", "new", "Paint", "(", "Paint", ".", "ANTI_ALIAS_FLAG", ")", ";", "framePaint", ".", "setStrokeWidth", "(", "indicatorFrameWidth", ")", ";", "framePaint", ".", "setStyle", "(", "Style", ".", "STROKE", ")", ";", "float", "r", "=", "Math", ".", "round", "(", "shapeRadius", "*", "0.8f", ")", ";", "rectFull", "=", "new", "RectF", "(", "-", "r", ",", "-", "r", ",", "r", ",", "r", ")", ";", "rectFullInset", "=", "new", "RectF", "(", "rectFull", ")", ";", "rectFullInset", ".", "inset", "(", "1f", ",", "1f", ")", ";", "r", "+=", "indicatorFrameWidth", ";", "rectFrame", "=", "new", "RectF", "(", "-", "r", ",", "-", "r", ",", "r", ",", "r", ")", ";", "Bitmap", "checkerboard", "=", "BitmapFactory", ".", "decodeResource", "(", "c", ".", "getResources", "(", ")", ",", "R", ".", "drawable", ".", "transparent", ")", ";", "BitmapShader", "shader", "=", "new", "BitmapShader", "(", "checkerboard", ",", "Shader", ".", "TileMode", ".", "REPEAT", ",", "Shader", ".", "TileMode", ".", "REPEAT", ")", ";", "checkeredPattern", "=", "new", "Paint", "(", ")", ";", "checkeredPattern", ".", "setShader", "(", "shader", ")", ";", "}", "final", "int", "getCenterX", "(", ")", "{", "return", "centerX", ";", "}", "final", "float", "getShapeRadius", "(", ")", "{", "return", "shapeRadius", ";", "}", "final", "boolean", "trackingCenter", "(", ")", "{", "return", "trackingCenter", ";", "}", "final", "void", "setShapeClickedListener", "(", "ShapeClickedListener", "l", ")", "{", "shapeClickedListener", "=", "l", ";", "}", "final", "void", "setShape", "(", "Shape", "s", ")", "{", "shape", "=", "s", ";", "invalidate", "(", ")", ";", "}", "final", "void", "setShapeDiameter", "(", "float", "d", ")", "{", "shapeDiameter", "=", "d", ";", "shapeRadius", "=", "shapeDiameter", "/", "2f", ";", "shapeDimensionsChanged", "(", ")", ";", "}", "final", "void", "setShapeRadius", "(", "float", "r", ")", "{", "shapeRadius", "=", "r", ";", "shapeDiameter", "=", "shapeRadius", "*", "2f", ";", "shapeDimensionsChanged", "(", ")", ";", "}", "private", "void", "shapeDimensionsChanged", "(", ")", "{", "float", "r", "=", "Math", ".", "round", "(", "shapeRadius", "*", "0.8f", ")", ";", "rectFull", ".", "set", "(", "-", "r", ",", "-", "r", ",", "r", ",", "r", ")", ";", "r", "+=", "indicatorFrameWidth", ";", "rectFrame", ".", "set", "(", "-", "r", ",", "-", "r", ",", "r", ",", "r", ")", ";", "invalidate", "(", ")", ";", "}", "void", "setShapeColorAlpha", "(", "int", "a", ")", "{", "shapePaint", ".", "setAlpha", "(", "a", ")", ";", "invalidate", "(", ")", ";", "}", "final", "void", "setShapeColor", "(", "int", "color", ")", "{", "shapePaint", ".", "setColor", "(", "color", ")", ";", "framePaint", ".", "setColor", "(", "color", ")", ";", "invalidate", "(", ")", ";", "}", "final", "int", "getShapeColor", "(", ")", "{", "return", "shapePaint", ".", "getColor", "(", ")", ";", "}", "private", "static", "final", "int", "FULL", "=", "0xFF", ";", "private", "static", "final", "int", "DIMMED", "=", "0x88", ";", "@", "Override", "protected", "void", "onDraw", "(", "Canvas", "canvas", ")", "{", "canvas", ".", "translate", "(", "centerX", ",", "centerX", ")", ";", "if", "(", "shape", "==", "Shape", ".", "RECT", ")", "{", "canvas", ".", "drawRect", "(", "rectFull", ",", "checkeredPattern", ")", ";", "canvas", ".", "drawRect", "(", "rectFull", ",", "shapePaint", ")", ";", "}", "else", "{", "canvas", ".", "drawCircle", "(", "0", ",", "0", ",", "shapeRadius", "-", "1f", ",", "checkeredPattern", ")", ";", "canvas", ".", "drawCircle", "(", "0", ",", "0", ",", "shapeRadius", ",", "shapePaint", ")", ";", "}", "if", "(", "trackingCenter", ")", "{", "if", "(", "!", "highlightCenter", ")", "{", "framePaint", ".", "setAlpha", "(", "DIMMED", ")", ";", "}", "else", "{", "framePaint", ".", "setAlpha", "(", "FULL", ")", ";", "}", "if", "(", "shape", "==", "Shape", ".", "RECT", ")", "{", "canvas", ".", "drawRect", "(", "rectFrame", ",", "framePaint", ")", ";", "}", "else", "{", "canvas", ".", "drawCircle", "(", "0", ",", "0", ",", "shapeRadius", "+", "framePaint", ".", "getStrokeWidth", "(", ")", ",", "framePaint", ")", ";", "}", "}", "}", "@", "Override", "protected", "final", "void", "onMeasure", "(", "int", "widthMeasureSpec", ",", "int", "heightMeasureSpec", ")", "{", "setMeasuredDimension", "(", "centerX", "*", "2", ",", "centerX", "*", "2", ")", ";", "}", "@", "Override", "public", "final", "boolean", "onTouchEvent", "(", "MotionEvent", "event", ")", "{", "final", "int", "action", "=", "event", ".", "getAction", "(", ")", ";", "final", "float", "x", "=", "event", ".", "getX", "(", ")", "-", "centerX", ";", "final", "float", "y", "=", "event", ".", "getY", "(", ")", "-", "centerX", ";", "final", "boolean", "inCenter", "=", "Math", ".", "sqrt", "(", "x", "*", "x", "+", "y", "*", "y", ")", "<=", "shapeRadius", ";", "switch", "(", "action", ")", "{", "case", "MotionEvent", ".", "ACTION_DOWN", ":", "trackingCenter", "=", "inCenter", ";", "if", "(", "inCenter", ")", "{", "highlightCenter", "=", "true", ";", "invalidate", "(", ")", ";", "}", "break", ";", "case", "MotionEvent", ".", "ACTION_MOVE", ":", "if", "(", "highlightCenter", "!=", "inCenter", ")", "{", "highlightCenter", "=", "inCenter", ";", "invalidate", "(", ")", ";", "}", "break", ";", "case", "MotionEvent", ".", "ACTION_UP", ":", "if", "(", "trackingCenter", "&&", "inCenter", "&&", "shapeClickedListener", "!=", "null", ")", "{", "shapeClickedListener", ".", "onShapeClicked", "(", ")", ";", "}", "trackingCenter", "=", "false", ";", "break", ";", "}", "handleMotionEvent", "(", "action", ",", "x", ",", "y", ")", ";", "return", "true", ";", "}", "protected", "abstract", "void", "handleMotionEvent", "(", "int", "action", ",", "float", "x", ",", "float", "y", ")", ";", "}", "</s>" ]
9,979
[ "<s>", "package", "at", ".", "droidcode", ".", "threadpaint", ".", "dialog", ";", "import", "android", ".", "app", ".", "AlertDialog", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "graphics", ".", "Paint", ";", "import", "android", ".", "graphics", ".", "Paint", ".", "Cap", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "widget", ".", "Button", ";", "import", "android", ".", "widget", ".", "SeekBar", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "R", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "TpApplication", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "dialog", ".", "ShapeView", ".", "Shape", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "dialog", ".", "ShapeView", ".", "ShapeClickedListener", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "ui", ".", "PaintView", ";", "public", "class", "ColorPickerDialog", "extends", "AlertDialog", "implements", "ShapeClickedListener", ",", "SeekBar", ".", "OnSeekBarChangeListener", "{", "public", "interface", "OnPaintChangedListener", "{", "void", "colorChanged", "(", "int", "color", ")", ";", "}", "private", "ColorDialView", "colorDialView", ";", "private", "final", "PaintView", "paintView", ";", "private", "final", "OnPaintChangedListener", "paintListener", ";", "public", "ColorPickerDialog", "(", "Context", "context", ",", "PaintView", "p", ")", "{", "super", "(", "context", ")", ";", "paintView", "=", "p", ";", "paintListener", "=", "p", ".", "getOnPaintChangedListener", "(", ")", ";", "}", "@", "Override", "protected", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "setContentView", "(", "R", ".", "layout", ".", "dialog_colorpicker", ")", ";", "colorDialView", "=", "(", "ColorDialView", ")", "findViewById", "(", "R", ".", "id", ".", "view_colordial", ")", ";", "colorDialView", ".", "setShapeClickedListener", "(", "this", ")", ";", "int", "x", "=", "(", "(", "TpApplication", ")", "getContext", "(", ")", ".", "getApplicationContext", "(", ")", ")", ".", "maxStrokeWidth", "(", ")", ";", "colorDialView", ".", "setShapeDiameter", "(", "x", "*", "0.66f", ")", ";", "final", "Button", "toggleButton", "=", "(", "Button", ")", "findViewById", "(", "R", ".", "id", ".", "btn_colorpicker_toggle_color", ")", ";", "toggleButton", ".", "setOnClickListener", "(", "new", "View", ".", "OnClickListener", "(", ")", "{", "@", "Override", "public", "void", "onClick", "(", "View", "v", ")", "{", "if", "(", "colorDialView", ".", "isGreyscale", "(", ")", ")", "{", "toggleButton", ".", "setText", "(", "R", ".", "string", ".", "btn_grey", ")", ";", "colorDialView", ".", "setGreyscale", "(", "false", ")", ";", "}", "else", "{", "toggleButton", ".", "setText", "(", "R", ".", "string", ".", "btn_color", ")", ";", "colorDialView", ".", "setGreyscale", "(", "true", ")", ";", "}", "}", "}", ")", ";", "final", "int", "color", "=", "getContext", "(", ")", ".", "getResources", "(", ")", ".", "getColor", "(", "R", ".", "color", ".", "stroke_standard", ")", ";", "colorDialView", ".", "setShapeColor", "(", "color", ")", ";", "final", "SeekBar", "alphaSeekBar", "=", "(", "SeekBar", ")", "findViewById", "(", "R", ".", "id", ".", "seekbar_color_alpha", ")", ";", "alphaSeekBar", ".", "setOnSeekBarChangeListener", "(", "this", ")", ";", "}", "@", "Override", "public", "void", "show", "(", ")", "{", "super", ".", "show", "(", ")", ";", "Paint", "pathPaint", "=", "paintView", ".", "getPathPaint", "(", ")", ";", "colorDialView", ".", "setShapeColor", "(", "pathPaint", ".", "getColor", "(", ")", ")", ";", "if", "(", "pathPaint", ".", "getStrokeCap", "(", ")", "==", "Cap", ".", "SQUARE", ")", "{", "colorDialView", ".", "setShape", "(", "Shape", ".", "RECT", ")", ";", "}", "else", "{", "colorDialView", ".", "setShape", "(", "Shape", ".", "CIRCLE", ")", ";", "}", "}", "@", "Override", "public", "void", "onShapeClicked", "(", ")", "{", "paintListener", ".", "colorChanged", "(", "colorDialView", ".", "getShapeColor", "(", ")", ")", ";", "dismiss", "(", ")", ";", "}", "@", "Override", "public", "void", "onProgressChanged", "(", "SeekBar", "seekBar", ",", "int", "progress", ",", "boolean", "fromUser", ")", "{", "colorDialView", ".", "setShapeColorAlpha", "(", "Math", ".", "round", "(", "255", "*", "(", "progress", "/", "100f", ")", ")", ")", ";", "}", "@", "Override", "public", "void", "onStartTrackingTouch", "(", "SeekBar", "seekBar", ")", "{", "}", "@", "Override", "public", "void", "onStopTrackingTouch", "(", "SeekBar", "seekBar", ")", "{", "}", "}", "</s>" ]
9,980
[ "<s>", "package", "at", ".", "droidcode", ".", "threadpaint", ".", "dialog", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "util", ".", "AttributeSet", ";", "public", "class", "BrushTipView", "extends", "ShapeView", "{", "public", "BrushTipView", "(", "Context", "c", ",", "AttributeSet", "attrs", ")", "{", "super", "(", "c", ",", "attrs", ")", ";", "}", "@", "Override", "protected", "void", "handleMotionEvent", "(", "int", "action", ",", "float", "x", ",", "float", "y", ")", "{", "}", "}", "</s>" ]
9,981
[ "<s>", "package", "at", ".", "droidcode", ".", "threadpaint", ".", "dialog", ";", "import", "android", ".", "app", ".", "AlertDialog", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "graphics", ".", "Paint", ".", "Cap", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "widget", ".", "Button", ";", "import", "android", ".", "widget", ".", "SeekBar", ";", "import", "android", ".", "widget", ".", "SeekBar", ".", "OnSeekBarChangeListener", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "R", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "TpApplication", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "dialog", ".", "ShapeView", ".", "Shape", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "dialog", ".", "ShapeView", ".", "ShapeClickedListener", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "ui", ".", "PaintView", ";", "public", "class", "BrushPickerDialog", "extends", "AlertDialog", "implements", "View", ".", "OnClickListener", ",", "OnSeekBarChangeListener", ",", "ShapeClickedListener", "{", "public", "interface", "OnBrushChangedListener", "{", "void", "capChanged", "(", "Cap", "cap", ")", ";", "void", "strokeChanged", "(", "int", "width", ")", ";", "}", "private", "BrushTipView", "brushTipView", ";", "private", "final", "PaintView", "paintView", ";", "private", "final", "int", "maxStrokeWidth", ";", "private", "final", "OnBrushChangedListener", "brushListener", ";", "public", "BrushPickerDialog", "(", "Context", "context", ",", "PaintView", "p", ")", "{", "super", "(", "context", ")", ";", "maxStrokeWidth", "=", "(", "(", "TpApplication", ")", "context", ".", "getApplicationContext", "(", ")", ")", ".", "maxStrokeWidth", "(", ")", ";", "brushListener", "=", "p", ".", "getOnBrushChangedListener", "(", ")", ";", "paintView", "=", "p", ";", "}", "@", "Override", "protected", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "setContentView", "(", "R", ".", "layout", ".", "dialog_brushpicker", ")", ";", "brushTipView", "=", "(", "BrushTipView", ")", "findViewById", "(", "R", ".", "id", ".", "view_brushtip", ")", ";", "brushTipView", ".", "setShapeClickedListener", "(", "this", ")", ";", "int", "x", "=", "(", "(", "TpApplication", ")", "getContext", "(", ")", ".", "getApplicationContext", "(", ")", ")", ".", "maxStrokeWidth", "(", ")", ";", "brushTipView", ".", "setShapeDiameter", "(", "x", "/", "2f", ")", ";", "final", "Button", "round", "=", "(", "Button", ")", "findViewById", "(", "R", ".", "id", ".", "btn_cap_round", ")", ";", "round", ".", "setOnClickListener", "(", "this", ")", ";", "final", "Button", "square", "=", "(", "Button", ")", "findViewById", "(", "R", ".", "id", ".", "btn_cap_squared", ")", ";", "square", ".", "setOnClickListener", "(", "this", ")", ";", "final", "SeekBar", "strokeSeekBar", "=", "(", "SeekBar", ")", "findViewById", "(", "R", ".", "id", ".", "seekbar_brush_tip", ")", ";", "strokeSeekBar", ".", "setOnSeekBarChangeListener", "(", "this", ")", ";", "}", "@", "Override", "public", "void", "show", "(", ")", "{", "super", ".", "show", "(", ")", ";", "brushTipView", ".", "setShapeColor", "(", "paintView", ".", "getPathPaint", "(", ")", ".", "getColor", "(", ")", ")", ";", "}", "@", "Override", "public", "void", "onClick", "(", "View", "v", ")", "{", "switch", "(", "v", ".", "getId", "(", ")", ")", "{", "case", "R", ".", "id", ".", "btn_cap_round", ":", "brushListener", ".", "capChanged", "(", "Cap", ".", "ROUND", ")", ";", "brushTipView", ".", "setShape", "(", "Shape", ".", "CIRCLE", ")", ";", "break", ";", "case", "R", ".", "id", ".", "btn_cap_squared", ":", "brushListener", ".", "capChanged", "(", "Cap", ".", "SQUARE", ")", ";", "brushTipView", ".", "setShape", "(", "Shape", ".", "RECT", ")", ";", "break", ";", "default", ":", "dismiss", "(", ")", ";", "}", "}", "@", "Override", "public", "void", "onProgressChanged", "(", "SeekBar", "seekBar", ",", "int", "progress", ",", "boolean", "fromUser", ")", "{", "final", "float", "percent", "=", "(", "float", ")", "progress", "/", "(", "float", ")", "seekBar", ".", "getMax", "(", ")", ";", "final", "int", "strokeWidth", "=", "Math", ".", "round", "(", "maxStrokeWidth", "*", "percent", ")", ";", "final", "BrushTipView", "colorPickerView", "=", "(", "BrushTipView", ")", "findViewById", "(", "R", ".", "id", ".", "view_brushtip", ")", ";", "colorPickerView", ".", "setShapeRadius", "(", "strokeWidth", "/", "2", ")", ";", "}", "@", "Override", "public", "void", "onStartTrackingTouch", "(", "SeekBar", "seekBar", ")", "{", "}", "@", "Override", "public", "void", "onStopTrackingTouch", "(", "SeekBar", "seekBar", ")", "{", "final", "float", "percent", "=", "(", "float", ")", "seekBar", ".", "getProgress", "(", ")", "/", "(", "float", ")", "seekBar", ".", "getMax", "(", ")", ";", "final", "int", "strokeWidth", "=", "Math", ".", "round", "(", "maxStrokeWidth", "*", "percent", ")", ";", "brushListener", ".", "strokeChanged", "(", "strokeWidth", ")", ";", "}", "@", "Override", "public", "void", "onShapeClicked", "(", ")", "{", "dismiss", "(", ")", ";", "}", "}", "</s>" ]
9,982
[ "<s>", "package", "at", ".", "droidcode", ".", "threadpaint", ".", "dialog", ";", "import", "static", "at", ".", "droidcode", ".", "threadpaint", ".", "TpApplication", ".", "TAG", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileOutputStream", ";", "import", "android", ".", "app", ".", "Dialog", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "graphics", ".", "Bitmap", ";", "import", "android", ".", "media", ".", "MediaScannerConnection", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "os", ".", "Environment", ";", "import", "android", ".", "util", ".", "Log", ";", "import", "android", ".", "view", ".", "Gravity", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "widget", ".", "EditText", ";", "import", "android", ".", "widget", ".", "Toast", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "R", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "TpMainActivity", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "Utils", ".", "ToastRunnable", ";", "public", "class", "SaveFileDialog", "extends", "Dialog", "implements", "View", ".", "OnClickListener", "{", "private", "final", "Bitmap", "bitmapToSave", ";", "private", "EditText", "editText", ";", "private", "class", "SaveBitmapThread", "extends", "Thread", "{", "private", "final", "String", "filename", ";", "private", "static", "final", "int", "QUALITY", "=", "90", ";", "private", "static", "final", "String", "ENDING", "=", "\".png\"", ";", "SaveBitmapThread", "(", "String", "name", ")", "{", "filename", "=", "name", "+", "ENDING", ";", "}", "@", "Override", "public", "void", "run", "(", ")", "{", "Context", "context", "=", "getContext", "(", ")", ";", "if", "(", "Environment", ".", "getExternalStorageState", "(", ")", ".", "equals", "(", "Environment", ".", "MEDIA_MOUNTED", ")", ")", "{", "File", "file", "=", "new", "File", "(", "context", ".", "getExternalFilesDir", "(", "Environment", ".", "DIRECTORY_PICTURES", ")", ",", "filename", ")", ";", "try", "{", "FileOutputStream", "fileOutputStream", "=", "new", "FileOutputStream", "(", "file", ")", ";", "bitmapToSave", ".", "compress", "(", "Bitmap", ".", "CompressFormat", ".", "PNG", ",", "QUALITY", ",", "fileOutputStream", ")", ";", "String", "[", "]", "paths", "=", "new", "String", "[", "]", "{", "file", ".", "getAbsolutePath", "(", ")", "}", ";", "MediaScannerConnection", ".", "scanFile", "(", "context", ",", "paths", ",", "null", ",", "null", ")", ";", "String", "success", "=", "context", ".", "getResources", "(", ")", ".", "getString", "(", "R", ".", "string", ".", "toast_save_success", ")", ";", "TpMainActivity", ".", "instance", ".", "runOnUiThread", "(", "new", "ToastRunnable", "(", "context", ",", "success", ")", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "Log", ".", "e", "(", "TAG", ",", "\"\"", "+", "file", ",", "e", ")", ";", "}", "}", "else", "{", "String", "error", "=", "context", ".", "getResources", "(", ")", ".", "getString", "(", "R", ".", "string", ".", "toast_media_not_mounted", ")", ";", "TpMainActivity", ".", "instance", ".", "runOnUiThread", "(", "new", "ToastRunnable", "(", "context", ",", "error", ")", ")", ";", "}", "}", "}", "public", "SaveFileDialog", "(", "Context", "context", ",", "Bitmap", "bitmap", ")", "{", "super", "(", "context", ")", ";", "bitmapToSave", "=", "bitmap", ";", "}", "@", "Override", "protected", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "setContentView", "(", "R", ".", "layout", ".", "dialog_savefile", ")", ";", "setTitle", "(", "getContext", "(", ")", ".", "getResources", "(", ")", ".", "getString", "(", "R", ".", "string", ".", "dialog_save", ")", ")", ";", "findViewById", "(", "R", ".", "id", ".", "btn_savefile_save", ")", ".", "setOnClickListener", "(", "this", ")", ";", "findViewById", "(", "R", ".", "id", ".", "btn_savefile_cancel", ")", ".", "setOnClickListener", "(", "this", ")", ";", "editText", "=", "(", "EditText", ")", "findViewById", "(", "R", ".", "id", ".", "txt_savefile_name", ")", ";", "editText", ".", "setText", "(", "getContext", "(", ")", ".", "getResources", "(", ")", ".", "getString", "(", "R", ".", "string", ".", "default_filename", ")", ")", ";", "}", "@", "Override", "public", "void", "onClick", "(", "View", "v", ")", "{", "switch", "(", "v", ".", "getId", "(", ")", ")", "{", "case", "R", ".", "id", ".", "btn_savefile_save", ":", "String", "filename", "=", "editText", ".", "getText", "(", ")", ".", "toString", "(", ")", ";", "if", "(", "filename", ".", "length", "(", ")", "==", "0", ")", "{", "CharSequence", "text", "=", "getContext", "(", ")", ".", "getResources", "(", ")", ".", "getString", "(", "R", ".", "string", ".", "toast_filename_error", ")", ";", "Toast", "toast", "=", "Toast", ".", "makeText", "(", "getContext", "(", ")", ",", "text", ",", "Toast", ".", "LENGTH_SHORT", ")", ";", "toast", ".", "setGravity", "(", "Gravity", ".", "TOP", ",", "0", ",", "0", ")", ";", "toast", ".", "show", "(", ")", ";", "}", "else", "{", "new", "SaveBitmapThread", "(", "filename", ")", ".", "start", "(", ")", ";", "dismiss", "(", ")", ";", "}", "break", ";", "case", "R", ".", "id", ".", "btn_savefile_cancel", ":", "cancel", "(", ")", ";", "break", ";", "}", "}", "}", "</s>" ]
9,983
[ "<s>", "package", "at", ".", "droidcode", ".", "threadpaint", ".", "dialog", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "res", ".", "TypedArray", ";", "import", "android", ".", "graphics", ".", "Canvas", ";", "import", "android", ".", "graphics", ".", "Color", ";", "import", "android", ".", "graphics", ".", "Paint", ";", "import", "android", ".", "graphics", ".", "RectF", ";", "import", "android", ".", "graphics", ".", "SweepGradient", ";", "import", "android", ".", "util", ".", "AttributeSet", ";", "import", "android", ".", "view", ".", "MotionEvent", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "R", ";", "public", "class", "ColorDialView", "extends", "ShapeView", "{", "private", "final", "RectF", "ovalRect", ";", "private", "final", "Paint", "gradientPaint", ";", "private", "int", "[", "]", "colorSpectrum", ";", "private", "boolean", "isGreyscale", ";", "private", "int", "alpha", ";", "public", "ColorDialView", "(", "Context", "c", ",", "AttributeSet", "attrs", ")", "{", "super", "(", "c", ",", "attrs", ")", ";", "gradientPaint", "=", "new", "Paint", "(", "Paint", ".", "ANTI_ALIAS_FLAG", ")", ";", "gradientPaint", ".", "setStyle", "(", "Paint", ".", "Style", ".", "STROKE", ")", ";", "gradientPaint", ".", "setStrokeWidth", "(", "getShapeRadius", "(", ")", "/", "2", ")", ";", "alpha", "=", "0xff", ";", "float", "r", "=", "getCenterX", "(", ")", "-", "(", "gradientPaint", ".", "getStrokeWidth", "(", ")", "/", "2", ")", ";", "ovalRect", "=", "new", "RectF", "(", "-", "r", ",", "-", "r", ",", "r", ",", "r", ")", ";", "setGreyscale", "(", "false", ")", ";", "}", "public", "boolean", "isGreyscale", "(", ")", "{", "return", "isGreyscale", ";", "}", "final", "void", "setGreyscale", "(", "boolean", "b", ")", "{", "isGreyscale", "=", "b", ";", "final", "TypedArray", "colorArray", ";", "if", "(", "b", ")", "{", "colorArray", "=", "getContext", "(", ")", ".", "getResources", "(", ")", ".", "obtainTypedArray", "(", "R", ".", "array", ".", "grey_spectrum", ")", ";", "setShapeColor", "(", "Color", ".", "WHITE", ")", ";", "}", "else", "{", "colorArray", "=", "getContext", "(", ")", ".", "getResources", "(", ")", ".", "obtainTypedArray", "(", "R", ".", "array", ".", "color_spectrum", ")", ";", "final", "int", "color", "=", "getContext", "(", ")", ".", "getResources", "(", ")", ".", "getColor", "(", "R", ".", "color", ".", "stroke_standard", ")", ";", "setShapeColor", "(", "color", ")", ";", "}", "colorSpectrum", "=", "new", "int", "[", "colorArray", ".", "length", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "colorArray", ".", "length", "(", ")", ";", "i", "++", ")", "{", "colorSpectrum", "[", "i", "]", "=", "colorArray", ".", "getColor", "(", "i", ",", "Color", ".", "BLACK", ")", ";", "}", "colorArray", ".", "recycle", "(", ")", ";", "gradientPaint", ".", "setShader", "(", "new", "SweepGradient", "(", "0", ",", "0", ",", "colorSpectrum", ",", "null", ")", ")", ";", "invalidate", "(", ")", ";", "}", "@", "Override", "final", "void", "setShapeColorAlpha", "(", "int", "a", ")", "{", "alpha", "=", "a", ";", "super", ".", "setShapeColorAlpha", "(", "a", ")", ";", "}", "@", "Override", "protected", "void", "onDraw", "(", "Canvas", "canvas", ")", "{", "super", ".", "onDraw", "(", "canvas", ")", ";", "canvas", ".", "drawOval", "(", "ovalRect", ",", "gradientPaint", ")", ";", "}", "private", "static", "int", "ave", "(", "int", "s", ",", "int", "d", ",", "float", "p", ")", "{", "return", "s", "+", "java", ".", "lang", ".", "Math", ".", "round", "(", "p", "*", "(", "d", "-", "s", ")", ")", ";", "}", "private", "int", "interpColor", "(", "float", "unit", ")", "{", "if", "(", "unit", "<=", "0", ")", "{", "return", "colorSpectrum", "[", "0", "]", ";", "}", "if", "(", "unit", ">=", "1", ")", "{", "return", "colorSpectrum", "[", "colorSpectrum", ".", "length", "-", "1", "]", ";", "}", "float", "p", "=", "unit", "*", "(", "colorSpectrum", ".", "length", "-", "1", ")", ";", "int", "i", "=", "(", "int", ")", "p", ";", "p", "-=", "i", ";", "int", "c0", "=", "colorSpectrum", "[", "i", "]", ";", "int", "c1", "=", "colorSpectrum", "[", "i", "+", "1", "]", ";", "int", "r", "=", "ave", "(", "Color", ".", "red", "(", "c0", ")", ",", "Color", ".", "red", "(", "c1", ")", ",", "p", ")", ";", "int", "g", "=", "ave", "(", "Color", ".", "green", "(", "c0", ")", ",", "Color", ".", "green", "(", "c1", ")", ",", "p", ")", ";", "int", "b", "=", "ave", "(", "Color", ".", "blue", "(", "c0", ")", ",", "Color", ".", "blue", "(", "c1", ")", ",", "p", ")", ";", "return", "Color", ".", "argb", "(", "alpha", ",", "r", ",", "g", ",", "b", ")", ";", "}", "private", "static", "final", "float", "PI", "=", "3.1415926f", ";", "@", "Override", "protected", "void", "handleMotionEvent", "(", "int", "action", ",", "float", "x", ",", "float", "y", ")", "{", "if", "(", "action", "==", "MotionEvent", ".", "ACTION_MOVE", "&&", "!", "trackingCenter", "(", ")", ")", "{", "float", "angle", "=", "(", "float", ")", "java", ".", "lang", ".", "Math", ".", "atan2", "(", "y", ",", "x", ")", ";", "float", "unit", "=", "angle", "/", "(", "2", "*", "PI", ")", ";", "if", "(", "unit", "<", "0", ")", "{", "unit", "+=", "1", ";", "}", "setShapeColor", "(", "interpColor", "(", "unit", ")", ")", ";", "invalidate", "(", ")", ";", "}", "}", "}", "</s>" ]
9,984
[ "<s>", "package", "at", ".", "droidcode", ".", "threadpaint", ".", "ui", ";", "import", "android", ".", "graphics", ".", "Bitmap", ";", "import", "android", ".", "graphics", ".", "Bitmap", ".", "Config", ";", "import", "android", ".", "graphics", ".", "BitmapFactory", ";", "import", "android", ".", "graphics", ".", "BitmapShader", ";", "import", "android", ".", "graphics", ".", "Canvas", ";", "import", "android", ".", "graphics", ".", "Color", ";", "import", "android", ".", "graphics", ".", "Paint", ";", "import", "android", ".", "graphics", ".", "Paint", ".", "Cap", ";", "import", "android", ".", "graphics", ".", "Path", ";", "import", "android", ".", "graphics", ".", "Point", ";", "import", "android", ".", "graphics", ".", "PointF", ";", "import", "android", ".", "graphics", ".", "PorterDuff", ";", "import", "android", ".", "graphics", ".", "PorterDuffXfermode", ";", "import", "android", ".", "graphics", ".", "Rect", ";", "import", "android", ".", "graphics", ".", "Shader", ";", "import", "android", ".", "graphics", ".", "Xfermode", ";", "import", "android", ".", "util", ".", "Log", ";", "import", "android", ".", "view", ".", "SurfaceHolder", ";", "import", "at", ".", "droidcode", ".", "commands", ".", "Command", ";", "import", "at", ".", "droidcode", ".", "commands", ".", "CommandManager", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "R", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "TpApplication", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "dialog", ".", "BrushPickerDialog", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "dialog", ".", "ColorPickerDialog", ";", "public", "class", "PaintRunner", "extends", "TpRunner", "implements", "ColorPickerDialog", ".", "OnPaintChangedListener", ",", "BrushPickerDialog", ".", "OnBrushChangedListener", "{", "private", "Bitmap", "drawingBitmap", ";", "private", "final", "Path", "pathToDraw", ";", "private", "final", "Canvas", "bitmapCanvas", ";", "private", "final", "Rect", "rectSurface", ";", "private", "final", "Rect", "rectBitmap", ";", "private", "final", "PointF", "surfaceCenter", ";", "private", "final", "Point", "scroll", ";", "private", "float", "zoom", ";", "private", "final", "Paint", "bitmapPathPaint", ";", "private", "final", "Paint", "canvasPathPaint", ";", "private", "final", "Paint", "checkeredPattern", ";", "private", "final", "Xfermode", "eraseXfermode", ";", "private", "final", "SurfaceHolder", "surfaceHolder", ";", "private", "final", "CommandManager", "commandManager", ";", "private", "class", "DrawLoop", "implements", "Runnable", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "Canvas", "canvas", "=", "null", ";", "try", "{", "canvas", "=", "surfaceHolder", ".", "lockCanvas", "(", ")", ";", "doDraw", "(", "canvas", ")", ";", "}", "finally", "{", "if", "(", "canvas", "!=", "null", ")", "{", "surfaceHolder", ".", "unlockCanvasAndPost", "(", "canvas", ")", ";", "}", "}", "}", "}", "public", "PaintRunner", "(", "PaintView", "paintView", ")", "{", "surfaceHolder", "=", "paintView", ".", "getHolder", "(", ")", ";", "commandManager", "=", "new", "CommandManager", "(", ")", ";", "super", ".", "setRunnable", "(", "new", "DrawLoop", "(", ")", ")", ";", "pathToDraw", "=", "new", "Path", "(", ")", ";", "pathToDraw", ".", "incReserve", "(", "42", ")", ";", "bitmapCanvas", "=", "new", "Canvas", "(", ")", ";", "rectSurface", "=", "new", "Rect", "(", ")", ";", "rectBitmap", "=", "new", "Rect", "(", ")", ";", "surfaceCenter", "=", "new", "PointF", "(", ")", ";", "scroll", "=", "new", "Point", "(", "0", ",", "0", ")", ";", "zoom", "=", "1f", ";", "final", "TpApplication", "appContext", "=", "(", "TpApplication", ")", "paintView", ".", "getContext", "(", ")", ".", "getApplicationContext", "(", ")", ";", "final", "int", "color", "=", "appContext", ".", "getResources", "(", ")", ".", "getColor", "(", "R", ".", "color", ".", "stroke_standard", ")", ";", "bitmapPathPaint", "=", "new", "Paint", "(", ")", ";", "bitmapPathPaint", ".", "setColor", "(", "color", ")", ";", "bitmapPathPaint", ".", "setAntiAlias", "(", "true", ")", ";", "bitmapPathPaint", ".", "setDither", "(", "true", ")", ";", "bitmapPathPaint", ".", "setStyle", "(", "Paint", ".", "Style", ".", "STROKE", ")", ";", "bitmapPathPaint", ".", "setStrokeJoin", "(", "Paint", ".", "Join", ".", "ROUND", ")", ";", "bitmapPathPaint", ".", "setStrokeCap", "(", "Paint", ".", "Cap", ".", "ROUND", ")", ";", "bitmapPathPaint", ".", "setStrokeWidth", "(", "appContext", ".", "maxStrokeWidth", "(", ")", "/", "2", ")", ";", "canvasPathPaint", "=", "new", "Paint", "(", "bitmapPathPaint", ")", ";", "Bitmap", "checkerboard", "=", "BitmapFactory", ".", "decodeResource", "(", "appContext", ".", "getResources", "(", ")", ",", "R", ".", "drawable", ".", "transparent", ")", ";", "BitmapShader", "shader", "=", "new", "BitmapShader", "(", "checkerboard", ",", "Shader", ".", "TileMode", ".", "REPEAT", ",", "Shader", ".", "TileMode", ".", "REPEAT", ")", ";", "checkeredPattern", "=", "new", "Paint", "(", ")", ";", "checkeredPattern", ".", "setShader", "(", "shader", ")", ";", "eraseXfermode", "=", "new", "PorterDuffXfermode", "(", "PorterDuff", ".", "Mode", ".", "CLEAR", ")", ";", "}", "@", "Override", "public", "synchronized", "void", "stop", "(", ")", "{", "super", ".", "stop", "(", ")", ";", "commandManager", ".", "clear", "(", ")", ";", "drawingBitmap", ".", "recycle", "(", ")", ";", "drawingBitmap", "=", "null", ";", "}", "private", "void", "doDraw", "(", "Canvas", "canvas", ")", "{", "canvas", ".", "scale", "(", "zoom", ",", "zoom", ",", "surfaceCenter", ".", "x", ",", "surfaceCenter", ".", "y", ")", ";", "canvas", ".", "translate", "(", "scroll", ".", "x", ",", "scroll", ".", "y", ")", ";", "canvas", ".", "drawPaint", "(", "checkeredPattern", ")", ";", "canvas", ".", "drawBitmap", "(", "drawingBitmap", ",", "0", ",", "0", ",", "null", ")", ";", "canvas", ".", "drawPath", "(", "pathToDraw", ",", "canvasPathPaint", ")", ";", "}", "@", "Override", "public", "void", "colorChanged", "(", "int", "color", ")", "{", "bitmapPathPaint", ".", "setColor", "(", "color", ")", ";", "canvasPathPaint", ".", "setColor", "(", "color", ")", ";", "if", "(", "Color", ".", "alpha", "(", "color", ")", "==", "0x00", ")", "{", "bitmapPathPaint", ".", "setXfermode", "(", "eraseXfermode", ")", ";", "canvasPathPaint", ".", "reset", "(", ")", ";", "canvasPathPaint", ".", "setStyle", "(", "bitmapPathPaint", ".", "getStyle", "(", ")", ")", ";", "canvasPathPaint", ".", "setStrokeJoin", "(", "bitmapPathPaint", ".", "getStrokeJoin", "(", ")", ")", ";", "canvasPathPaint", ".", "setStrokeCap", "(", "bitmapPathPaint", ".", "getStrokeCap", "(", ")", ")", ";", "canvasPathPaint", ".", "setStrokeWidth", "(", "bitmapPathPaint", ".", "getStrokeWidth", "(", ")", ")", ";", "canvasPathPaint", ".", "setShader", "(", "checkeredPattern", ".", "getShader", "(", ")", ")", ";", "}", "else", "{", "bitmapPathPaint", ".", "setXfermode", "(", "null", ")", ";", "canvasPathPaint", ".", "set", "(", "bitmapPathPaint", ")", ";", "}", "}", "@", "Override", "public", "void", "capChanged", "(", "Cap", "cap", ")", "{", "bitmapPathPaint", ".", "setStrokeCap", "(", "cap", ")", ";", "canvasPathPaint", ".", "setStrokeCap", "(", "cap", ")", ";", "}", "@", "Override", "public", "void", "strokeChanged", "(", "int", "width", ")", "{", "bitmapPathPaint", ".", "setStrokeWidth", "(", "width", ")", ";", "canvasPathPaint", ".", "setStrokeWidth", "(", "width", ")", ";", "}", "void", "setSurfaceSize", "(", "int", "width", ",", "int", "height", ")", "{", "synchronized", "(", "pThread", ")", "{", "resetPerspective", "(", ")", ";", "rectSurface", ".", "set", "(", "0", ",", "0", ",", "width", ",", "height", ")", ";", "surfaceCenter", ".", "x", "=", "rectSurface", ".", "exactCenterX", "(", ")", ";", "surfaceCenter", ".", "y", "=", "rectSurface", ".", "exactCenterY", "(", ")", ";", "if", "(", "drawingBitmap", "==", "null", ")", "{", "Log", ".", "w", "(", "TpApplication", ".", "TAG", ",", "\"\"", ")", ";", "drawingBitmap", "=", "Bitmap", ".", "createBitmap", "(", "width", ",", "height", ",", "Config", ".", "ARGB_8888", ")", ";", "rectBitmap", ".", "set", "(", "0", ",", "0", ",", "width", ",", "height", ")", ";", "bitmapCanvas", ".", "setBitmap", "(", "drawingBitmap", ")", ";", "commandManager", ".", "reset", "(", "drawingBitmap", ")", ";", "}", "}", "}", "void", "setBitmap", "(", "Bitmap", "bitmap", ")", "{", "synchronized", "(", "pThread", ")", "{", "if", "(", "drawingBitmap", "!=", "null", ")", "{", "drawingBitmap", ".", "recycle", "(", ")", ";", "}", "resetPerspective", "(", ")", ";", "drawingBitmap", "=", "bitmap", ";", "commandManager", ".", "reset", "(", "bitmap", ")", ";", "bitmapCanvas", ".", "setBitmap", "(", "drawingBitmap", ")", ";", "rectBitmap", ".", "set", "(", "0", ",", "0", ",", "bitmap", ".", "getWidth", "(", ")", ",", "bitmap", ".", "getHeight", "(", ")", ")", ";", "}", "}", "Bitmap", "getBitmap", "(", ")", "{", "return", "drawingBitmap", ";", "}", "Paint", "getPaint", "(", ")", "{", "return", "bitmapPathPaint", ";", "}", "float", "getZoom", "(", ")", "{", "return", "zoom", ";", "}", "void", "startPath", "(", "float", "x", ",", "float", "y", ")", "{", "pathToDraw", ".", "rewind", "(", ")", ";", "translate", "(", "x", ",", "y", ")", ";", "pathToDraw", ".", "moveTo", "(", "translate", ".", "x", ",", "translate", ".", "y", ")", ";", "}", "void", "updatePath", "(", "float", "x1", ",", "float", "y1", ",", "float", "x2", ",", "float", "y2", ")", "{", "translate", "(", "(", "x1", "+", "x2", ")", "/", "2f", ",", "(", "y1", "+", "y2", ")", "/", "2f", ")", ";", "float", "cx", "=", "translate", ".", "x", ";", "float", "cy", "=", "translate", ".", "y", ";", "translate", "(", "x2", ",", "y2", ")", ";", "pathToDraw", ".", "quadTo", "(", "cx", ",", "cy", ",", "translate", ".", "x", ",", "translate", ".", "y", ")", ";", "}", "void", "finishPath", "(", ")", "{", "synchronized", "(", "pThread", ")", "{", "Command", "command", "=", "new", "Command", "(", "bitmapPathPaint", ",", "pathToDraw", ")", ";", "commandManager", ".", "commitCommand", "(", "command", ",", "bitmapCanvas", ")", ";", "pathToDraw", ".", "rewind", "(", ")", ";", "}", "}", "void", "drawPoint", "(", "float", "x", ",", "float", "y", ")", "{", "synchronized", "(", "pThread", ")", "{", "translate", "(", "x", ",", "y", ")", ";", "Command", "command", "=", "new", "Command", "(", "bitmapPathPaint", ",", "translate", ")", ";", "commandManager", ".", "commitCommand", "(", "command", ",", "bitmapCanvas", ")", ";", "}", "}", "void", "scroll", "(", "int", "dx", ",", "int", "dy", ")", "{", "synchronized", "(", "pThread", ")", "{", "float", "surfaceZoomedWidth", "=", "rectSurface", ".", "right", "/", "zoom", ";", "float", "surfaceZoomedHeight", "=", "rectSurface", ".", "bottom", "/", "zoom", ";", "if", "(", "(", "surfaceZoomedWidth", "-", "rectBitmap", ".", "right", ")", ">", "0", "&&", "(", "surfaceZoomedHeight", "-", "rectBitmap", ".", "bottom", ")", ">", "0", ")", "{", "scroll", ".", "set", "(", "0", ",", "0", ")", ";", "}", "else", "{", "scroll", ".", "offset", "(", "Math", ".", "round", "(", "dx", "/", "zoom", ")", ",", "Math", ".", "round", "(", "dy", "/", "zoom", ")", ")", ";", "float", "pivotX", "=", "surfaceCenter", ".", "x", "-", "(", "surfaceCenter", ".", "x", "/", "zoom", ")", ";", "float", "pivotY", "=", "surfaceCenter", ".", "y", "-", "(", "surfaceCenter", ".", "y", "/", "zoom", ")", ";", "float", "xMax", "=", "(", "surfaceZoomedWidth", "-", "rectBitmap", ".", "right", ")", "+", "pivotX", ";", "float", "yMax", "=", "(", "surfaceZoomedHeight", "-", "rectBitmap", ".", "bottom", ")", "+", "pivotY", ";", "if", "(", "scroll", ".", "x", "<", "xMax", ")", "{", "scroll", ".", "x", "=", "Math", ".", "round", "(", "xMax", ")", ";", "}", "if", "(", "scroll", ".", "y", "<", "yMax", ")", "{", "scroll", ".", "y", "=", "Math", ".", "round", "(", "yMax", ")", ";", "}", "if", "(", "scroll", ".", "x", "-", "pivotX", ">", "0", ")", "{", "scroll", ".", "x", "=", "Math", ".", "round", "(", "pivotX", ")", ";", "}", "if", "(", "scroll", ".", "y", "-", "pivotY", ">", "0", ")", "{", "scroll", ".", "y", "=", "Math", ".", "round", "(", "pivotY", ")", ";", "}", "}", "}", "}", "void", "zoom", "(", "float", "scale", ")", "{", "synchronized", "(", "pThread", ")", "{", "if", "(", "zoom", ">=", "1", ")", "{", "zoom", "=", "scale", ";", "}", "if", "(", "zoom", "<", "1", ")", "{", "zoom", "=", "1", ";", "}", "}", "}", "private", "final", "Point", "translate", "=", "new", "Point", "(", ")", ";", "private", "void", "translate", "(", "float", "x", ",", "float", "y", ")", "{", "translate", ".", "x", "=", "(", "int", ")", "(", "(", "x", "-", "surfaceCenter", ".", "x", ")", "/", "zoom", "+", "surfaceCenter", ".", "x", "-", "scroll", ".", "x", ")", ";", "translate", ".", "y", "=", "(", "int", ")", "(", "(", "y", "-", "surfaceCenter", ".", "y", ")", "/", "zoom", "+", "surfaceCenter", ".", "y", "-", "scroll", ".", "y", ")", ";", "}", "private", "void", "resetPerspective", "(", ")", "{", "zoom", "=", "1f", ";", "scroll", ".", "set", "(", "0", ",", "0", ")", ";", "bitmapCanvas", ".", "setMatrix", "(", "null", ")", ";", "}", "void", "fillWithPaint", "(", ")", "{", "Command", "command", "=", "new", "Command", "(", "bitmapPathPaint", ")", ";", "commandManager", ".", "commitCommand", "(", "command", ",", "bitmapCanvas", ")", ";", "}", "void", "resetCanvas", "(", ")", "{", "Bitmap", "bitmap", "=", "Bitmap", ".", "createBitmap", "(", "rectSurface", ".", "right", ",", "rectSurface", ".", "bottom", ",", "Config", ".", "ARGB_8888", ")", ";", "setBitmap", "(", "bitmap", ")", ";", "}", "void", "undo", "(", ")", "{", "synchronized", "(", "pThread", ")", "{", "commandManager", ".", "undoLast", "(", "bitmapCanvas", ")", ";", "}", "}", "void", "redo", "(", ")", "{", "synchronized", "(", "pThread", ")", "{", "commandManager", ".", "redoLast", "(", "bitmapCanvas", ")", ";", "}", "}", "}", "</s>" ]
9,985
[ "<s>", "package", "at", ".", "droidcode", ".", "threadpaint", ".", "ui", ";", "import", "static", "at", ".", "droidcode", ".", "threadpaint", ".", "TpApplication", ".", "TAG", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "graphics", ".", "Bitmap", ";", "import", "android", ".", "graphics", ".", "Paint", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "util", ".", "AttributeSet", ";", "import", "android", ".", "util", ".", "FloatMath", ";", "import", "android", ".", "util", ".", "Log", ";", "import", "android", ".", "view", ".", "MotionEvent", ";", "import", "android", ".", "view", ".", "SurfaceHolder", ";", "import", "android", ".", "view", ".", "SurfaceView", ";", "import", "android", ".", "view", ".", "View", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "api", ".", "ToolButtonAnimator", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "dialog", ".", "BrushPickerDialog", ".", "OnBrushChangedListener", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "dialog", ".", "ColorPickerDialog", ".", "OnPaintChangedListener", ";", "public", "class", "PaintView", "extends", "SurfaceView", "implements", "SurfaceHolder", ".", "Callback", ",", "View", ".", "OnTouchListener", "{", "public", "enum", "Tool", "{", "BRUSH", ",", "MOVE", ",", "ERASE", "}", ";", "private", "Tool", "selectedTool", ";", "private", "float", "moveThreshold", ";", "private", "final", "PaintRunner", "paintRunner", ";", "private", "ToolButtonAnimator", "toolButtonAnimator", ";", "private", "static", "final", "String", "STATE_BITMAP", "=", "\"\"", ";", "public", "PaintView", "(", "Context", "context", ",", "AttributeSet", "attrs", ")", "{", "super", "(", "context", ",", "attrs", ")", ";", "Log", ".", "d", "(", "TAG", ",", "\"\"", ")", ";", "SurfaceHolder", "holder", "=", "getHolder", "(", ")", ";", "holder", ".", "addCallback", "(", "this", ")", ";", "setFocusable", "(", "true", ")", ";", "setOnTouchListener", "(", "this", ")", ";", "selectedTool", "=", "Tool", ".", "BRUSH", ";", "moveThreshold", "=", "1.0f", ";", "paintRunner", "=", "new", "PaintRunner", "(", "this", ")", ";", "}", "@", "Override", "public", "void", "surfaceChanged", "(", "SurfaceHolder", "holder", ",", "int", "format", ",", "int", "width", ",", "int", "height", ")", "{", "Log", ".", "w", "(", "TAG", ",", "\"\"", ")", ";", "paintRunner", ".", "setSurfaceSize", "(", "width", ",", "height", ")", ";", "}", "@", "Override", "public", "void", "surfaceCreated", "(", "SurfaceHolder", "holder", ")", "{", "Log", ".", "w", "(", "TAG", ",", "\"\"", ")", ";", "paintRunner", ".", "start", "(", ")", ";", "}", "@", "Override", "public", "void", "surfaceDestroyed", "(", "SurfaceHolder", "holder", ")", "{", "Log", ".", "w", "(", "TAG", ",", "\"\"", ")", ";", "paintRunner", ".", "setPaused", "(", "true", ")", ";", "}", "public", "synchronized", "void", "saveState", "(", "Bundle", "b", ")", "{", "b", ".", "putParcelable", "(", "STATE_BITMAP", ",", "getBitmap", "(", ")", ")", ";", "}", "public", "synchronized", "void", "restoreState", "(", "Bundle", "savedState", ")", "{", "Log", ".", "d", "(", "TAG", ",", "\"\"", ")", ";", "Bitmap", "savedBmp", "=", "(", "Bitmap", ")", "savedState", ".", "getParcelable", "(", "STATE_BITMAP", ")", ";", "if", "(", "!", "savedBmp", ".", "isRecycled", "(", ")", ")", "{", "paintRunner", ".", "setBitmap", "(", "savedBmp", ")", ";", "}", "}", "public", "void", "stopPaintThread", "(", ")", "{", "paintRunner", ".", "stop", "(", ")", ";", "}", "public", "void", "setToolButtonAnimator", "(", "ToolButtonAnimator", "animator", ")", "{", "toolButtonAnimator", "=", "animator", ";", "}", "public", "void", "setMoveThreshold", "(", "float", "f", ")", "{", "moveThreshold", "=", "f", ";", "}", "public", "Tool", "selectedTool", "(", ")", "{", "return", "selectedTool", ";", "}", "public", "void", "selectTool", "(", "Tool", "tool", ")", "{", "selectedTool", "=", "tool", ";", "}", "public", "Bitmap", "getBitmap", "(", ")", "{", "return", "paintRunner", ".", "getBitmap", "(", ")", ";", "}", "public", "Paint", "getPathPaint", "(", ")", "{", "return", "paintRunner", ".", "getPaint", "(", ")", ";", "}", "public", "synchronized", "void", "setBitmap", "(", "Bitmap", "bitmap", ")", "{", "Log", ".", "d", "(", "TAG", ",", "\"setBitmap\"", ")", ";", "paintRunner", ".", "setBitmap", "(", "bitmap", ")", ";", "}", "public", "void", "setPaintColor", "(", "int", "color", ")", "{", "paintRunner", ".", "colorChanged", "(", "color", ")", ";", "}", "public", "void", "fillWithPaint", "(", ")", "{", "paintRunner", ".", "fillWithPaint", "(", ")", ";", "}", "public", "void", "resetCanvas", "(", ")", "{", "paintRunner", ".", "resetCanvas", "(", ")", ";", "}", "public", "void", "undo", "(", ")", "{", "paintRunner", ".", "undo", "(", ")", ";", "}", "public", "void", "redo", "(", ")", "{", "paintRunner", ".", "redo", "(", ")", ";", "}", "public", "OnPaintChangedListener", "getOnPaintChangedListener", "(", ")", "{", "return", "paintRunner", ";", "}", "public", "OnBrushChangedListener", "getOnBrushChangedListener", "(", ")", "{", "return", "paintRunner", ";", "}", "private", "float", "xTouchCoordinate", ";", "private", "float", "yTouchCoordinate", ";", "private", "float", "previousX", ";", "private", "float", "previousY", ";", "private", "float", "oldDist", ";", "private", "boolean", "hasMoved", ";", "private", "boolean", "pinchToZoom", ";", "@", "Override", "public", "boolean", "onTouch", "(", "View", "v", ",", "MotionEvent", "event", ")", "{", "xTouchCoordinate", "=", "event", ".", "getX", "(", ")", ";", "yTouchCoordinate", "=", "event", ".", "getY", "(", ")", ";", "switch", "(", "event", ".", "getAction", "(", ")", ")", "{", "case", "MotionEvent", ".", "ACTION_DOWN", ":", "previousX", "=", "xTouchCoordinate", ";", "previousY", "=", "yTouchCoordinate", ";", "hasMoved", "=", "false", ";", "break", ";", "case", "MotionEvent", ".", "ACTION_MOVE", ":", "float", "dx", "=", "Math", ".", "abs", "(", "xTouchCoordinate", "-", "previousX", ")", ";", "float", "dy", "=", "Math", ".", "abs", "(", "yTouchCoordinate", "-", "previousY", ")", ";", "if", "(", "dx", ">", "moveThreshold", "||", "dy", ">", "moveThreshold", ")", "{", "hasMoved", "=", "true", ";", "}", "break", ";", "}", "handlePinchToZoom", "(", "event", ")", ";", "if", "(", "!", "pinchToZoom", ")", "{", "switch", "(", "selectedTool", ")", "{", "case", "ERASE", ":", "case", "BRUSH", ":", "handleBrushTool", "(", "event", ")", ";", "break", ";", "case", "MOVE", ":", "handleMoveTool", "(", "event", ")", ";", "break", ";", "}", "}", "previousX", "=", "xTouchCoordinate", ";", "previousY", "=", "yTouchCoordinate", ";", "return", "true", ";", "}", "private", "void", "handleBrushTool", "(", "MotionEvent", "event", ")", "{", "switch", "(", "event", ".", "getAction", "(", ")", ")", "{", "case", "MotionEvent", ".", "ACTION_DOWN", ":", "paintRunner", ".", "startPath", "(", "xTouchCoordinate", ",", "yTouchCoordinate", ")", ";", "toolButtonAnimator", ".", "fadeOutToolButtons", "(", ")", ";", "break", ";", "case", "MotionEvent", ".", "ACTION_MOVE", ":", "if", "(", "hasMoved", ")", "{", "paintRunner", ".", "updatePath", "(", "previousX", ",", "previousY", ",", "xTouchCoordinate", ",", "yTouchCoordinate", ")", ";", "}", "break", ";", "case", "MotionEvent", ".", "ACTION_UP", ":", "if", "(", "hasMoved", ")", "{", "paintRunner", ".", "finishPath", "(", ")", ";", "}", "else", "{", "paintRunner", ".", "drawPoint", "(", "xTouchCoordinate", ",", "yTouchCoordinate", ")", ";", "}", "toolButtonAnimator", ".", "fadeInToolButtons", "(", ")", ";", "break", ";", "}", "}", "private", "float", "spacing", "(", "MotionEvent", "event", ")", "{", "float", "x", "=", "event", ".", "getX", "(", "0", ")", "-", "event", ".", "getX", "(", "1", ")", ";", "float", "y", "=", "event", ".", "getY", "(", "0", ")", "-", "event", ".", "getY", "(", "1", ")", ";", "return", "FloatMath", ".", "sqrt", "(", "x", "*", "x", "+", "y", "*", "y", ")", ";", "}", "private", "void", "handleMoveTool", "(", "MotionEvent", "event", ")", "{", "switch", "(", "event", ".", "getAction", "(", ")", ")", "{", "case", "MotionEvent", ".", "ACTION_MOVE", ":", "int", "dx", "=", "Math", ".", "round", "(", "xTouchCoordinate", "-", "previousX", ")", ";", "int", "dy", "=", "Math", ".", "round", "(", "yTouchCoordinate", "-", "previousY", ")", ";", "paintRunner", ".", "scroll", "(", "dx", ",", "dy", ")", ";", "break", ";", "}", "}", "private", "void", "handlePinchToZoom", "(", "MotionEvent", "event", ")", "{", "switch", "(", "event", ".", "getAction", "(", ")", ")", "{", "case", "MotionEvent", ".", "ACTION_POINTER_2_DOWN", ":", "oldDist", "=", "spacing", "(", "event", ")", "/", "paintRunner", ".", "getZoom", "(", ")", ";", "pinchToZoom", "=", "true", ";", "break", ";", "case", "MotionEvent", ".", "ACTION_MOVE", ":", "if", "(", "pinchToZoom", ")", "{", "float", "newDist", "=", "spacing", "(", "event", ")", ";", "if", "(", "newDist", ">", "10", ")", "{", "float", "scale", "=", "newDist", "/", "oldDist", ";", "paintRunner", ".", "zoom", "(", "scale", ")", ";", "}", "}", "break", ";", "default", ":", "pinchToZoom", "=", "false", ";", "}", "}", "}", "</s>" ]
9,986
[ "<s>", "package", "at", ".", "droidcode", ".", "threadpaint", ".", "ui", ";", "import", "static", "at", ".", "droidcode", ".", "threadpaint", ".", "TpApplication", ".", "TAG", ";", "import", "java", ".", "lang", ".", "Thread", ".", "State", ";", "import", "android", ".", "util", ".", "Log", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "TpApplication", ";", "public", "class", "TpRunner", "{", "protected", "final", "Thread", "pThread", ";", "private", "Runnable", "pRunnable", ";", "private", "boolean", "running", ";", "private", "boolean", "paused", ";", "public", "TpRunner", "(", ")", "{", "pThread", "=", "new", "Thread", "(", "new", "InternalRunnable", "(", ")", ")", ";", "pThread", ".", "setDaemon", "(", "true", ")", ";", "}", "private", "class", "InternalRunnable", "implements", "Runnable", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "internalRun", "(", ")", ";", "}", "}", "private", "void", "internalRun", "(", ")", "{", "while", "(", "running", ")", "{", "synchronized", "(", "pThread", ")", "{", "if", "(", "paused", ")", "{", "try", "{", "pThread", ".", "wait", "(", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "Log", ".", "e", "(", "TpApplication", ".", "TAG", ",", "\"ERROR", "\"", ",", "e", ")", ";", "}", "}", "else", "{", "pRunnable", ".", "run", "(", ")", ";", "}", "}", "}", "}", "public", "synchronized", "void", "setRunnable", "(", "Runnable", "runnable", ")", "{", "pRunnable", "=", "runnable", ";", "}", "public", "synchronized", "void", "start", "(", ")", "{", "if", "(", "pRunnable", "==", "null", "||", "pThread", ".", "getState", "(", ")", ".", "equals", "(", "State", ".", "TERMINATED", ")", ")", "{", "return", ";", "}", "running", "=", "true", ";", "if", "(", "paused", ")", "{", "setPaused", "(", "false", ")", ";", "}", "else", "{", "pThread", ".", "start", "(", ")", ";", "}", "}", "public", "synchronized", "void", "stop", "(", ")", "{", "running", "=", "false", ";", "setPaused", "(", "false", ")", ";", "if", "(", "pThread", ".", "isAlive", "(", ")", ")", "{", "boolean", "retry", "=", "true", ";", "while", "(", "retry", ")", "{", "try", "{", "pThread", ".", "join", "(", ")", ";", "retry", "=", "false", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "Log", ".", "e", "(", "TAG", ",", "\"ERROR", "\"", ",", "e", ")", ";", "}", "}", "}", "}", "public", "synchronized", "void", "setPaused", "(", "boolean", "pause", ")", "{", "synchronized", "(", "pThread", ")", "{", "if", "(", "!", "pause", "&&", "paused", ")", "{", "pThread", ".", "notify", "(", ")", ";", "}", "paused", "=", "pause", ";", "}", "}", "}", "</s>" ]
9,987
[ "<s>", "package", "at", ".", "droidcode", ".", "threadpaint", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Hashtable", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "android", ".", "content", ".", "SharedPreferences", ";", "import", "android", ".", "content", ".", "SharedPreferences", ".", "OnSharedPreferenceChangeListener", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "preference", ".", "PreferenceActivity", ";", "import", "android", ".", "preference", ".", "PreferenceManager", ";", "import", "at", ".", "droidcode", ".", "threadpaint", ".", "api", ".", "PreferencesCallback", ";", "public", "class", "TpPreferencesActivity", "extends", "PreferenceActivity", "implements", "OnSharedPreferenceChangeListener", ",", "PreferencesCallback", "{", "public", "enum", "Preference", "{", "LOCKORIENTATION", "(", "\"\"", ")", ",", "MOVETHRESHOLD", "(", "\"\"", ")", ";", "private", "final", "String", "key", ";", "Preference", "(", "String", "k", ")", "{", "key", "=", "k", ";", "}", "String", "key", "(", ")", "{", "return", "key", ";", "}", "}", "private", "static", "final", "Map", "<", "String", ",", "ArrayList", "<", "PreferencesCallback", ">", ">", "ACTIVITY_DIRECTORY", "=", "new", "Hashtable", "<", "String", ",", "ArrayList", "<", "PreferencesCallback", ">", ">", "(", ")", ";", "@", "Override", "public", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "addPreferencesFromResource", "(", "R", ".", "xml", ".", "preferences", ")", ";", "final", "SharedPreferences", "prefs", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "getApplicationContext", "(", ")", ")", ";", "prefs", ".", "registerOnSharedPreferenceChangeListener", "(", "this", ")", ";", "addCallbackForPreference", "(", "this", ",", "Preference", ".", "LOCKORIENTATION", ")", ";", "}", "@", "Override", "public", "void", "onDestroy", "(", ")", "{", "removeCallback", "(", "this", ")", ";", "super", ".", "onDestroy", "(", ")", ";", "}", "public", "static", "void", "addCallbackForPreference", "(", "PreferencesCallback", "c", ",", "Preference", "preference", ")", "{", "if", "(", "ACTIVITY_DIRECTORY", ".", "containsKey", "(", "preference", ".", "key", "(", ")", ")", ")", "{", "ACTIVITY_DIRECTORY", ".", "get", "(", "preference", ".", "key", "(", ")", ")", ".", "add", "(", "c", ")", ";", "}", "else", "{", "final", "ArrayList", "<", "PreferencesCallback", ">", "list", "=", "new", "ArrayList", "<", "PreferencesCallback", ">", "(", "1", ")", ";", "list", ".", "add", "(", "c", ")", ";", "ACTIVITY_DIRECTORY", ".", "put", "(", "preference", ".", "key", "(", ")", ",", "list", ")", ";", "}", "}", "public", "static", "boolean", "removeCallback", "(", "PreferencesCallback", "c", ")", "{", "boolean", "result", "=", "false", ";", "for", "(", "Preference", "p", ":", "Preference", ".", "values", "(", ")", ")", "{", "ArrayList", "<", "PreferencesCallback", ">", "list", "=", "ACTIVITY_DIRECTORY", ".", "get", "(", "p", ")", ";", "if", "(", "list", "!=", "null", ")", "{", "list", ".", "remove", "(", "c", ")", ";", "}", "}", "return", "result", ";", "}", "@", "Override", "public", "void", "onSharedPreferenceChanged", "(", "SharedPreferences", "sharedPreferences", ",", "String", "key", ")", "{", "ArrayList", "<", "PreferencesCallback", ">", "callbacks", "=", "ACTIVITY_DIRECTORY", ".", "get", "(", "key", ")", ";", "if", "(", "callbacks", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "callbacks", ".", "size", "(", ")", ";", "i", "++", ")", "{", "callbacks", ".", "get", "(", "i", ")", ".", "preferenceChanged", "(", "sharedPreferences", ",", "key", ")", ";", "}", "}", "}", "@", "Override", "public", "void", "preferenceChanged", "(", "SharedPreferences", "preferences", ",", "String", "key", ")", "{", "if", "(", "key", ".", "equals", "(", "Preference", ".", "LOCKORIENTATION", ".", "key", "(", ")", ")", ")", "{", "boolean", "lock", "=", "preferences", ".", "getBoolean", "(", "key", ",", "true", ")", ";", "Utils", ".", "lockScreenOrientation", "(", "lock", ",", "this", ")", ";", "}", "}", "}", "</s>" ]
9,988
[ "<s>", "package", "com", ".", "datastax", ".", "tutorial", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "Keyspace", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "beans", ".", "OrderedRows", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "factory", ".", "HFactory", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "query", ".", "QueryResult", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "query", ".", "RangeSlicesQuery", ";", "public", "class", "GetRangeSlicesForStateCity", "extends", "TutorialCommand", "{", "public", "GetRangeSlicesForStateCity", "(", "Keyspace", "keyspace", ")", "{", "super", "(", "keyspace", ")", ";", "}", "@", "Override", "public", "QueryResult", "<", "OrderedRows", "<", "String", ",", "String", ",", "String", ">", ">", "execute", "(", ")", "{", "RangeSlicesQuery", "<", "String", ",", "String", ",", "String", ">", "rangeSlicesQuery", "=", "HFactory", ".", "createRangeSlicesQuery", "(", "keyspace", ",", "stringSerializer", ",", "stringSerializer", ",", "stringSerializer", ")", ";", "rangeSlicesQuery", ".", "setColumnFamily", "(", "\"Npanxx\"", ")", ";", "rangeSlicesQuery", ".", "setColumnNames", "(", "\"city\"", ",", "\"state\"", ",", "\"lat\"", ",", "\"lng\"", ")", ";", "rangeSlicesQuery", ".", "setKeys", "(", "\"512202\"", ",", "\"512205\"", ")", ";", "rangeSlicesQuery", ".", "setRowCount", "(", "5", ")", ";", "QueryResult", "<", "OrderedRows", "<", "String", ",", "String", ",", "String", ">", ">", "results", "=", "rangeSlicesQuery", ".", "execute", "(", ")", ";", "return", "results", ";", "}", "}", "</s>" ]
9,989
[ "<s>", "package", "com", ".", "datastax", ".", "tutorial", ";", "import", "me", ".", "prettyprint", ".", "cassandra", ".", "serializers", ".", "LongSerializer", ";", "import", "me", ".", "prettyprint", ".", "cassandra", ".", "serializers", ".", "StringSerializer", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "Keyspace", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "ResultStatus", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "Serializer", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "query", ".", "QueryResult", ";", "import", "org", ".", "slf4j", ".", "Logger", ";", "import", "org", ".", "slf4j", ".", "LoggerFactory", ";", "public", "abstract", "class", "TutorialCommand", "{", "protected", "Logger", "log", "=", "LoggerFactory", ".", "getLogger", "(", "TutorialCommand", ".", "class", ")", ";", "protected", "Keyspace", "keyspace", ";", "public", "TutorialCommand", "(", "Keyspace", "keyspace", ")", "{", "this", ".", "keyspace", "=", "keyspace", ";", "}", "public", "abstract", "ResultStatus", "execute", "(", ")", ";", "static", "StringSerializer", "stringSerializer", "=", "StringSerializer", ".", "get", "(", ")", ";", "static", "LongSerializer", "longSerializer", "=", "LongSerializer", ".", "get", "(", ")", ";", "}", "</s>" ]
9,990
[ "<s>", "package", "com", ".", "datastax", ".", "tutorial", ";", "import", "me", ".", "prettyprint", ".", "cassandra", ".", "model", ".", "HColumnImpl", ";", "import", "me", ".", "prettyprint", ".", "cassandra", ".", "serializers", ".", "DynamicCompositeSerializer", ";", "import", "me", ".", "prettyprint", ".", "cassandra", ".", "serializers", ".", "LongSerializer", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "Keyspace", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "ResultStatus", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "beans", ".", "AbstractComposite", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "beans", ".", "ColumnSlice", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "beans", ".", "Composite", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "beans", ".", "DynamicComposite", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "factory", ".", "HFactory", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "mutation", ".", "Mutator", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "query", ".", "QueryResult", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "query", ".", "SliceQuery", ";", "public", "class", "DynamicCompositeIndex", "extends", "TutorialCommand", "{", "private", "static", "DynamicCompositeSerializer", "dcs", "=", "new", "DynamicCompositeSerializer", "(", ")", ";", "public", "DynamicCompositeIndex", "(", "Keyspace", "keyspace", ")", "{", "super", "(", "keyspace", ")", ";", "}", "@", "Override", "public", "ResultStatus", "execute", "(", ")", "{", "Mutator", "<", "String", ">", "mutator", "=", "HFactory", ".", "createMutator", "(", "keyspace", ",", "stringSerializer", ")", ";", "HColumnImpl", "<", "DynamicComposite", ",", "String", ">", "column", "=", "new", "HColumnImpl", "<", "DynamicComposite", ",", "String", ">", "(", "dcs", ",", "stringSerializer", ")", ";", "column", ".", "setClock", "(", "keyspace", ".", "createClock", "(", ")", ")", ";", "DynamicComposite", "dc", "=", "new", "DynamicComposite", "(", ")", ";", "dc", ".", "add", "(", "0", ",", "\"Austin\"", ")", ";", "dc", ".", "add", "(", "1", ",", "7516L", ")", ";", "dc", ".", "add", "(", "2", ",", "225L", ")", ";", "column", ".", "setName", "(", "dc", ")", ";", "column", ".", "setValue", "(", "\"\"", ")", ";", "mutator", ".", "addInsertion", "(", "\"TX:512\"", ",", "\"\"", ",", "column", ")", ";", "column", "=", "new", "HColumnImpl", "<", "DynamicComposite", ",", "String", ">", "(", "dcs", ",", "stringSerializer", ")", ";", "column", ".", "setClock", "(", "keyspace", ".", "createClock", "(", ")", ")", ";", "dc", "=", "new", "DynamicComposite", "(", ")", ";", "dc", ".", "add", "(", "0", ",", "\"225\"", ")", ";", "column", ".", "setName", "(", "dc", ")", ";", "column", ".", "setValue", "(", "\"\"", ")", ";", "mutator", ".", "addInsertion", "(", "\"TX:512\"", ",", "\"\"", ",", "column", ")", ";", "column", "=", "new", "HColumnImpl", "<", "DynamicComposite", ",", "String", ">", "(", "dcs", ",", "stringSerializer", ")", ";", "column", ".", "setClock", "(", "keyspace", ".", "createClock", "(", ")", ")", ";", "dc", "=", "new", "DynamicComposite", "(", ")", ";", "dc", ".", "add", "(", "0", ",", "\"Austin\"", ")", ";", "dc", ".", "add", "(", "1", ",", "7516L", ")", ";", "dc", ".", "add", "(", "2", ",", "334L", ")", ";", "column", ".", "setName", "(", "dc", ")", ";", "column", ".", "setValue", "(", "\"\"", ")", ";", "mutator", ".", "addInsertion", "(", "\"TX:512\"", ",", "\"\"", ",", "column", ")", ";", "column", "=", "new", "HColumnImpl", "<", "DynamicComposite", ",", "String", ">", "(", "dcs", ",", "stringSerializer", ")", ";", "column", ".", "setClock", "(", "keyspace", ".", "createClock", "(", ")", ")", ";", "dc", "=", "new", "DynamicComposite", "(", ")", ";", "dc", ".", "add", "(", "0", ",", "\"334\"", ")", ";", "dc", ".", "add", "(", "1", ",", "7516L", ")", ";", "column", ".", "setName", "(", "dc", ")", ";", "column", ".", "setValue", "(", "\"\"", ")", ";", "mutator", ".", "addInsertion", "(", "\"TX:512\"", ",", "\"\"", ",", "column", ")", ";", "column", "=", "new", "HColumnImpl", "<", "DynamicComposite", ",", "String", ">", "(", "dcs", ",", "stringSerializer", ")", ";", "column", ".", "setClock", "(", "keyspace", ".", "createClock", "(", ")", ")", ";", "dc", "=", "new", "DynamicComposite", "(", ")", ";", "dc", ".", "add", "(", "0", ",", "\"Austin\"", ")", ";", "dc", ".", "add", "(", "1", ",", "7516L", ")", ";", "dc", ".", "add", "(", "2", ",", "439L", ")", ";", "column", ".", "setName", "(", "dc", ")", ";", "column", ".", "setValue", "(", "\"\"", ")", ";", "mutator", ".", "addInsertion", "(", "\"TX:512\"", ",", "\"\"", ",", "column", ")", ";", "column", "=", "new", "HColumnImpl", "<", "DynamicComposite", ",", "String", ">", "(", "dcs", ",", "stringSerializer", ")", ";", "column", ".", "setClock", "(", "keyspace", ".", "createClock", "(", ")", ")", ";", "dc", "=", "new", "DynamicComposite", "(", ")", ";", "dc", ".", "add", "(", "0", ",", "\"Austin\"", ")", ";", "dc", ".", "add", "(", "1", ",", "5830L", ")", ";", "dc", ".", "add", "(", "2", ",", "215L", ")", ";", "column", ".", "setName", "(", "dc", ")", ";", "column", ".", "setValue", "(", "\"\"", ")", ";", "mutator", ".", "addInsertion", "(", "\"TX:512\"", ",", "\"\"", ",", "column", ")", ";", "column", "=", "new", "HColumnImpl", "<", "DynamicComposite", ",", "String", ">", "(", "dcs", ",", "stringSerializer", ")", ";", "column", ".", "setClock", "(", "keyspace", ".", "createClock", "(", ")", ")", ";", "dc", "=", "new", "DynamicComposite", "(", ")", ";", "dc", ".", "add", "(", "0", ",", "\"Lockhart\"", ")", ";", "dc", ".", "add", "(", "1", ",", "9533L", ")", ";", "dc", ".", "add", "(", "2", ",", "227L", ")", ";", "column", ".", "setName", "(", "dc", ")", ";", "column", ".", "setValue", "(", "\"\"", ")", ";", "mutator", ".", "addInsertion", "(", "\"TX:512\"", ",", "\"\"", ",", "column", ")", ";", "mutator", ".", "execute", "(", ")", ";", "SliceQuery", "<", "String", ",", "DynamicComposite", ",", "String", ">", "sliceQuery", "=", "HFactory", ".", "createSliceQuery", "(", "keyspace", ",", "stringSerializer", ",", "dcs", ",", "stringSerializer", ")", ";", "sliceQuery", ".", "setColumnFamily", "(", "\"\"", ")", ";", "sliceQuery", ".", "setKey", "(", "\"TX:512\"", ")", ";", "DynamicComposite", "startRange", "=", "new", "DynamicComposite", "(", ")", ";", "startRange", ".", "add", "(", "0", ",", "\"Austin\"", ")", ";", "DynamicComposite", "endRange", "=", "new", "DynamicComposite", "(", ")", ";", "endRange", ".", "add", "(", "0", ",", "\"Austin\"", ")", ";", "endRange", ".", "addComponent", "(", "new", "Long", "(", "5830", ")", ",", "LongSerializer", ".", "get", "(", ")", ",", "\"LongType\"", ",", "AbstractComposite", ".", "ComponentEquality", ".", "GREATER_THAN_EQUAL", ")", ";", "sliceQuery", ".", "setRange", "(", "startRange", ",", "endRange", ",", "false", ",", "10", ")", ";", "QueryResult", "<", "ColumnSlice", "<", "DynamicComposite", ",", "String", ">", ">", "result", "=", "sliceQuery", ".", "execute", "(", ")", ";", "return", "result", ";", "}", "}", "</s>" ]
9,991
[ "<s>", "package", "com", ".", "datastax", ".", "tutorial", ";", "import", "me", ".", "prettyprint", ".", "cassandra", ".", "model", ".", "IndexedSlicesQuery", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "Keyspace", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "beans", ".", "OrderedRows", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "factory", ".", "HFactory", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "query", ".", "QueryResult", ";", "public", "class", "GetIndexedSlicesForCityState", "extends", "TutorialCommand", "{", "public", "GetIndexedSlicesForCityState", "(", "Keyspace", "keyspace", ")", "{", "super", "(", "keyspace", ")", ";", "}", "@", "Override", "public", "QueryResult", "<", "OrderedRows", "<", "String", ",", "String", ",", "String", ">", ">", "execute", "(", ")", "{", "IndexedSlicesQuery", "<", "String", ",", "String", ",", "String", ">", "indexedSlicesQuery", "=", "HFactory", ".", "createIndexedSlicesQuery", "(", "keyspace", ",", "stringSerializer", ",", "stringSerializer", ",", "stringSerializer", ")", ";", "indexedSlicesQuery", ".", "setColumnFamily", "(", "\"Npanxx\"", ")", ";", "indexedSlicesQuery", ".", "setColumnNames", "(", "\"city\"", ",", "\"lat\"", ",", "\"lng\"", ")", ";", "indexedSlicesQuery", ".", "addEqualsExpression", "(", "\"state\"", ",", "\"TX\"", ")", ";", "indexedSlicesQuery", ".", "addEqualsExpression", "(", "\"city\"", ",", "\"Austin\"", ")", ";", "indexedSlicesQuery", ".", "addGteExpression", "(", "\"lat\"", ",", "\"30.30\"", ")", ";", "QueryResult", "<", "OrderedRows", "<", "String", ",", "String", ",", "String", ">", ">", "result", "=", "indexedSlicesQuery", ".", "execute", "(", ")", ";", "return", "result", ";", "}", "}", "</s>" ]
9,992
[ "<s>", "package", "com", ".", "datastax", ".", "tutorial", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "Keyspace", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "factory", ".", "HFactory", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "mutation", ".", "MutationResult", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "mutation", ".", "Mutator", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "query", ".", "QueryResult", ";", "public", "class", "DeleteRowsForColumnFamily", "extends", "TutorialCommand", "{", "public", "DeleteRowsForColumnFamily", "(", "Keyspace", "keyspace", ")", "{", "super", "(", "keyspace", ")", ";", "}", "@", "Override", "public", "QueryResult", "<", "?", ">", "execute", "(", ")", "{", "Mutator", "<", "String", ">", "mutator", "=", "HFactory", ".", "createMutator", "(", "keyspace", ",", "stringSerializer", ")", ";", "mutator", ".", "addDeletion", "(", "\"\"", ",", "\"StateCity\"", ",", "null", ",", "stringSerializer", ")", ";", "mutator", ".", "addDeletion", "(", "\"650\"", ",", "\"AreaCode\"", ",", "null", ",", "stringSerializer", ")", ";", "mutator", ".", "addDeletion", "(", "\"650222\"", ",", "\"Npanxx\"", ",", "null", ",", "stringSerializer", ")", ";", "MutationResult", "mr", "=", "mutator", ".", "execute", "(", ")", ";", "return", "null", ";", "}", "}", "</s>" ]
9,993
[ "<s>", "package", "com", ".", "datastax", ".", "tutorial", ";", "import", "java", ".", "io", ".", "BufferedReader", ";", "import", "java", ".", "io", ".", "FileInputStream", ";", "import", "java", ".", "io", ".", "InputStreamReader", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "concurrent", ".", "Callable", ";", "import", "java", ".", "util", ".", "concurrent", ".", "ExecutorService", ";", "import", "java", ".", "util", ".", "concurrent", ".", "Executors", ";", "import", "java", ".", "util", ".", "concurrent", ".", "Future", ";", "import", "me", ".", "prettyprint", ".", "cassandra", ".", "serializers", ".", "StringSerializer", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "factory", ".", "HFactory", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "mutation", ".", "Mutator", ";", "import", "org", ".", "slf4j", ".", "Logger", ";", "import", "org", ".", "slf4j", ".", "LoggerFactory", ";", "public", "class", "NpanxxDatasetLoader", "extends", "TutorialBase", "{", "private", "static", "Logger", "log", "=", "LoggerFactory", ".", "getLogger", "(", "NpanxxDatasetLoader", ".", "class", ")", ";", "private", "static", "ExecutorService", "exec", ";", "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "long", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "init", "(", ")", ";", "String", "fileLocation", "=", "properties", ".", "getProperty", "(", "\"\"", ")", ";", "BufferedReader", "reader", ";", "exec", "=", "Executors", ".", "newFixedThreadPool", "(", "10", ")", ";", "try", "{", "reader", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "new", "FileInputStream", "(", "fileLocation", ")", ")", ")", ";", "List", "<", "String", ">", "lines", "=", "new", "ArrayList", "<", "String", ">", "(", "1000", ")", ";", "String", "line", "=", "reader", ".", "readLine", "(", ")", ";", "List", "<", "Future", "<", "Integer", ">", ">", "sums", "=", "new", "ArrayList", "<", "Future", "<", "Integer", ">", ">", "(", ")", ";", "while", "(", "line", "!=", "null", ")", "{", "lines", ".", "add", "(", "line", ")", ";", "if", "(", "lines", ".", "size", "(", ")", "%", "1000", "==", "0", ")", "{", "doParse", "(", "lines", ",", "sums", ")", ";", "}", "line", "=", "reader", ".", "readLine", "(", ")", ";", "}", "doParse", "(", "lines", ",", "sums", ")", ";", "int", "total", "=", "0", ";", "for", "(", "Future", "<", "Integer", ">", "future", ":", "sums", ")", "{", "total", "=", "total", "+", "future", ".", "get", "(", ")", ".", "intValue", "(", ")", ";", "}", "log", ".", "info", "(", "\"\"", ",", "total", ")", ";", "log", ".", "info", "(", "\"\"", ",", "System", ".", "currentTimeMillis", "(", ")", "-", "startTime", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "log", ".", "error", "(", "\"\"", ",", "e", ")", ";", "}", "finally", "{", "exec", ".", "shutdown", "(", ")", ";", "}", "tutorialCluster", ".", "getConnectionManager", "(", ")", ".", "shutdown", "(", ")", ";", "}", "private", "static", "void", "doParse", "(", "List", "<", "String", ">", "lines", ",", "List", "<", "Future", "<", "Integer", ">", ">", "sums", ")", "{", "Future", "<", "Integer", ">", "f", "=", "exec", ".", "submit", "(", "new", "NpanxxDatasetLoader", "(", ")", ".", "new", "LineParser", "(", "new", "ArrayList", "(", "lines", ")", ")", ")", ";", "sums", ".", "add", "(", "f", ")", ";", "lines", ".", "clear", "(", ")", ";", "}", "class", "LineParser", "implements", "Callable", "<", "Integer", ">", "{", "List", "<", "String", ">", "lines", ";", "LineParser", "(", "List", "<", "String", ">", "lines", ")", "{", "this", ".", "lines", "=", "lines", ";", "}", "public", "Integer", "call", "(", ")", "throws", "Exception", "{", "int", "count", "=", "0", ";", "NpanxxLine", "npanxxLine", ";", "Mutator", "<", "String", ">", "mutator", "=", "HFactory", ".", "createMutator", "(", "tutorialKeyspace", ",", "StringSerializer", ".", "get", "(", ")", ")", ";", "for", "(", "String", "row", ":", "lines", ")", "{", "npanxxLine", "=", "new", "NpanxxLine", "(", "row", ")", ";", "String", "key", "=", "npanxxLine", ".", "getNpa", "(", ")", "+", "npanxxLine", ".", "getNxx", "(", ")", ";", "mutator", ".", "addInsertion", "(", "key", ",", "\"Npanxx\"", ",", "HFactory", ".", "createStringColumn", "(", "\"city\"", ",", "npanxxLine", ".", "getCity", "(", ")", ")", ")", ";", "mutator", ".", "addInsertion", "(", "key", ",", "\"Npanxx\"", ",", "HFactory", ".", "createStringColumn", "(", "\"lat\"", ",", "Double", ".", "toString", "(", "npanxxLine", ".", "getLat", "(", ")", ")", ")", ")", ";", "mutator", ".", "addInsertion", "(", "key", ",", "\"Npanxx\"", ",", "HFactory", ".", "createStringColumn", "(", "\"lng\"", ",", "Double", ".", "toString", "(", "npanxxLine", ".", "getLng", "(", ")", ")", ")", ")", ";", "mutator", ".", "addInsertion", "(", "key", ",", "\"Npanxx\"", ",", "HFactory", ".", "createStringColumn", "(", "\"state\"", ",", "npanxxLine", ".", "getState", "(", ")", ")", ")", ";", "if", "(", "count", "%", "250", "==", "0", ")", "{", "mutator", ".", "execute", "(", ")", ";", "mutator", ".", "discardPendingMutations", "(", ")", ";", "}", "count", "++", ";", "}", "mutator", ".", "execute", "(", ")", ";", "log", ".", "info", "(", "\"\"", ",", "count", ")", ";", "return", "Integer", ".", "valueOf", "(", "count", ")", ";", "}", "}", "static", "class", "NpanxxLine", "{", "private", "String", "[", "]", "vals", "=", "new", "String", "[", "10", "]", ";", "NpanxxLine", "(", "String", "line", ")", "{", "vals", "=", "line", ".", "split", "(", "\"\\\\s\"", ")", ";", "}", "String", "getNpa", "(", ")", "{", "return", "vals", "[", "0", "]", ";", "}", "String", "getNxx", "(", ")", "{", "return", "vals", "[", "1", "]", ";", "}", "double", "getLat", "(", ")", "{", "return", "Double", ".", "parseDouble", "(", "vals", "[", "2", "]", ")", ";", "}", "double", "getLng", "(", ")", "{", "return", "Double", ".", "parseDouble", "(", "vals", "[", "3", "]", ")", ";", "}", "String", "getState", "(", ")", "{", "return", "vals", "[", "5", "]", ";", "}", "String", "getCity", "(", ")", "{", "StringBuilder", "cityName", "=", "new", "StringBuilder", "(", "56", ")", ";", "for", "(", "int", "i", "=", "6", ";", "i", "<", "vals", ".", "length", ";", "i", "++", ")", "{", "cityName", ".", "append", "(", "vals", "[", "i", "]", ")", ".", "append", "(", "\"", "\"", ")", ";", "}", "return", "cityName", ".", "toString", "(", ")", ";", "}", "}", "}", "</s>" ]
9,994
[ "<s>", "package", "com", ".", "datastax", ".", "tutorial", ";", "import", "me", ".", "prettyprint", ".", "cassandra", ".", "model", ".", "HColumnImpl", ";", "import", "me", ".", "prettyprint", ".", "cassandra", ".", "serializers", ".", "CompositeSerializer", ";", "import", "me", ".", "prettyprint", ".", "cassandra", ".", "serializers", ".", "StringSerializer", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "Keyspace", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "ResultStatus", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "beans", ".", "ColumnSlice", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "beans", ".", "Composite", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "beans", ".", "HColumn", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "factory", ".", "HFactory", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "mutation", ".", "Mutator", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "query", ".", "QueryResult", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "query", ".", "SliceQuery", ";", "public", "class", "StaticCompositeIndex", "extends", "TutorialCommand", "{", "private", "static", "final", "CompositeSerializer", "cs", "=", "new", "CompositeSerializer", "(", ")", ";", "public", "StaticCompositeIndex", "(", "Keyspace", "keyspace", ")", "{", "super", "(", "keyspace", ")", ";", "}", "@", "Override", "public", "ResultStatus", "execute", "(", ")", "{", "Mutator", "<", "String", ">", "mutator", "=", "HFactory", ".", "createMutator", "(", "keyspace", ",", "stringSerializer", ")", ";", "HColumnImpl", "<", "Composite", ",", "String", ">", "column", "=", "new", "HColumnImpl", "<", "Composite", ",", "String", ">", "(", "cs", ",", "stringSerializer", ")", ";", "column", ".", "setClock", "(", "keyspace", ".", "createClock", "(", ")", ")", ";", "Composite", "dc", "=", "new", "Composite", "(", ")", ";", "dc", ".", "add", "(", "0", ",", "\"Austin\"", ")", ";", "dc", ".", "add", "(", "1", ",", "7516L", ")", ";", "dc", ".", "add", "(", "2", ",", "225L", ")", ";", "column", ".", "setName", "(", "dc", ")", ";", "column", ".", "setValue", "(", "\"\"", ")", ";", "mutator", ".", "addInsertion", "(", "\"TX:512\"", ",", "\"\"", ",", "column", ")", ";", "column", "=", "new", "HColumnImpl", "<", "Composite", ",", "String", ">", "(", "cs", ",", "stringSerializer", ")", ";", "column", ".", "setClock", "(", "keyspace", ".", "createClock", "(", ")", ")", ";", "dc", "=", "new", "Composite", "(", ")", ";", "dc", ".", "add", "(", "0", ",", "\"Austin\"", ")", ";", "dc", ".", "add", "(", "1", ",", "7516L", ")", ";", "dc", ".", "add", "(", "2", ",", "334L", ")", ";", "column", ".", "setName", "(", "dc", ")", ";", "column", ".", "setValue", "(", "\"\"", ")", ";", "mutator", ".", "addInsertion", "(", "\"TX:512\"", ",", "\"\"", ",", "column", ")", ";", "column", "=", "new", "HColumnImpl", "<", "Composite", ",", "String", ">", "(", "cs", ",", "stringSerializer", ")", ";", "column", ".", "setClock", "(", "keyspace", ".", "createClock", "(", ")", ")", ";", "dc", "=", "new", "Composite", "(", ")", ";", "dc", ".", "add", "(", "0", ",", "\"Austin\"", ")", ";", "dc", ".", "add", "(", "1", ",", "7516L", ")", ";", "dc", ".", "add", "(", "2", ",", "439L", ")", ";", "column", ".", "setName", "(", "dc", ")", ";", "column", ".", "setValue", "(", "\"\"", ")", ";", "mutator", ".", "addInsertion", "(", "\"TX:512\"", ",", "\"\"", ",", "column", ")", ";", "column", "=", "new", "HColumnImpl", "<", "Composite", ",", "String", ">", "(", "cs", ",", "stringSerializer", ")", ";", "column", ".", "setClock", "(", "keyspace", ".", "createClock", "(", ")", ")", ";", "dc", "=", "new", "Composite", "(", ")", ";", "dc", ".", "add", "(", "0", ",", "\"Austin\"", ")", ";", "dc", ".", "add", "(", "1", ",", "5830L", ")", ";", "dc", ".", "add", "(", "2", ",", "215L", ")", ";", "column", ".", "setName", "(", "dc", ")", ";", "column", ".", "setValue", "(", "\"\"", ")", ";", "mutator", ".", "addInsertion", "(", "\"TX:512\"", ",", "\"\"", ",", "column", ")", ";", "column", "=", "new", "HColumnImpl", "<", "Composite", ",", "String", ">", "(", "cs", ",", "stringSerializer", ")", ";", "column", ".", "setClock", "(", "keyspace", ".", "createClock", "(", ")", ")", ";", "dc", "=", "new", "Composite", "(", ")", ";", "dc", ".", "add", "(", "0", ",", "\"Aardvark\"", ")", ";", "dc", ".", "add", "(", "1", ",", "5830L", ")", ";", "dc", ".", "add", "(", "2", ",", "215L", ")", ";", "column", ".", "setName", "(", "dc", ")", ";", "column", ".", "setValue", "(", "\"\"", ")", ";", "mutator", ".", "addInsertion", "(", "\"TX:512\"", ",", "\"\"", ",", "column", ")", ";", "column", "=", "new", "HColumnImpl", "<", "Composite", ",", "String", ">", "(", "cs", ",", "stringSerializer", ")", ";", "column", ".", "setClock", "(", "keyspace", ".", "createClock", "(", ")", ")", ";", "dc", "=", "new", "Composite", "(", ")", ";", "dc", ".", "add", "(", "0", ",", "\"Lockhart\"", ")", ";", "dc", ".", "add", "(", "1", ",", "9533L", ")", ";", "dc", ".", "add", "(", "2", ",", "227L", ")", ";", "column", ".", "setName", "(", "dc", ")", ";", "column", ".", "setValue", "(", "\"\"", ")", ";", "mutator", ".", "addInsertion", "(", "\"TX:512\"", ",", "\"\"", ",", "column", ")", ";", "mutator", ".", "execute", "(", ")", ";", "SliceQuery", "<", "String", ",", "Composite", ",", "String", ">", "sliceQuery", "=", "HFactory", ".", "createSliceQuery", "(", "keyspace", ",", "stringSerializer", ",", "cs", ",", "stringSerializer", ")", ";", "sliceQuery", ".", "setColumnFamily", "(", "\"\"", ")", ";", "sliceQuery", ".", "setKey", "(", "\"TX:512\"", ")", ";", "Composite", "startRange", "=", "new", "Composite", "(", ")", ";", "startRange", ".", "add", "(", "0", ",", "\"A\"", ")", ";", "Composite", "endRange", "=", "new", "Composite", "(", ")", ";", "endRange", ".", "add", "(", "0", ",", "\"B\"", ")", ";", "sliceQuery", ".", "setRange", "(", "startRange", ",", "endRange", ",", "false", ",", "10", ")", ";", "QueryResult", "<", "ColumnSlice", "<", "Composite", ",", "String", ">", ">", "result", "=", "sliceQuery", ".", "execute", "(", ")", ";", "ColumnSlice", "<", "Composite", ",", "String", ">", "cs", "=", "result", ".", "get", "(", ")", ";", "for", "(", "HColumn", "<", "Composite", ",", "String", ">", "col", ":", "cs", ".", "getColumns", "(", ")", ")", "{", "System", ".", "out", ".", "println", "(", "col", ".", "getName", "(", ")", ".", "getComponents", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "col", ".", "getName", "(", ")", ".", "get", "(", "0", ",", "StringSerializer", ".", "get", "(", ")", ")", ")", ";", "}", "return", "result", ";", "}", "}", "</s>" ]
9,995
[ "<s>", "package", "com", ".", "datastax", ".", "tutorial", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "ResultStatus", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "beans", ".", "ColumnSlice", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "beans", ".", "Row", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "beans", ".", "Rows", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "query", ".", "QueryResult", ";", "import", "org", ".", "slf4j", ".", "Logger", ";", "import", "org", ".", "slf4j", ".", "LoggerFactory", ";", "public", "class", "TutorialRunner", "extends", "TutorialBase", "{", "private", "static", "Logger", "log", "=", "LoggerFactory", ".", "getLogger", "(", "TutorialRunner", ".", "class", ")", ";", "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "init", "(", ")", ";", "TutorialCommand", "command", "=", "loadCommand", "(", "args", "[", "0", "]", ")", ";", "if", "(", "command", "!=", "null", ")", "{", "try", "{", "ResultStatus", "result", "=", "command", ".", "execute", "(", ")", ";", "if", "(", "result", "!=", "null", ")", "printResults", "(", "result", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "log", ".", "error", "(", "\"\"", ",", "e", ")", ";", "}", "}", "tutorialCluster", ".", "getConnectionManager", "(", ")", ".", "shutdown", "(", ")", ";", "}", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "static", "void", "printResults", "(", "ResultStatus", "result", ")", "{", "log", ".", "info", "(", "\"\"", ")", ";", "log", ".", "info", "(", "\"\"", ",", "result", ".", "getExecutionTimeMicro", "(", ")", ",", "result", ".", "getHostUsed", "(", ")", ".", "getName", "(", ")", ")", ";", "log", ".", "info", "(", "\"\"", ")", ";", "if", "(", "result", "instanceof", "QueryResult", ")", "{", "System", ".", "out", ".", "println", "(", "(", "(", "QueryResult", ")", "result", ")", ".", "get", "(", ")", ")", ";", "QueryResult", "<", "?", ">", "qr", "=", "(", "QueryResult", ")", "result", ";", "if", "(", "qr", ".", "get", "(", ")", "instanceof", "Rows", ")", "{", "Rows", "<", "?", ",", "?", ",", "?", ">", "rows", "=", "(", "Rows", ")", "qr", ".", "get", "(", ")", ";", "for", "(", "Row", "row", ":", "rows", ")", "{", "log", ".", "info", "(", "\"\"", ",", "row", ".", "getKey", "(", ")", ")", ";", "for", "(", "Iterator", "iter", "=", "row", ".", "getColumnSlice", "(", ")", ".", "getColumns", "(", ")", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "log", ".", "info", "(", "\"|", "col:", "{}\"", ",", "iter", ".", "next", "(", ")", ")", ";", "}", "}", "}", "else", "if", "(", "qr", ".", "get", "(", ")", "instanceof", "ColumnSlice", ")", "{", "for", "(", "Iterator", "iter", "=", "(", "(", "ColumnSlice", ")", "qr", ".", "get", "(", ")", ")", ".", "getColumns", "(", ")", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "log", ".", "info", "(", "\"|", "col:", "{}\"", ",", "iter", ".", "next", "(", ")", ")", ";", "}", "}", "else", "{", "log", ".", "info", "(", "\"|", "Result:", "{}\"", ",", "qr", ".", "get", "(", ")", ")", ";", "}", "}", "log", ".", "info", "(", "\"\"", ")", ";", "}", "private", "static", "TutorialCommand", "loadCommand", "(", "String", "cmd", ")", "{", "if", "(", "cmd", ".", "equalsIgnoreCase", "(", "\"get\"", ")", ")", "{", "return", "new", "GetCityForNpanxx", "(", "tutorialKeyspace", ")", ";", "}", "else", "if", "(", "cmd", ".", "equalsIgnoreCase", "(", "\"get_slice\"", ")", ")", "{", "return", "new", "GetSliceForNpanxx", "(", "tutorialKeyspace", ")", ";", "}", "else", "if", "(", "cmd", ".", "equalsIgnoreCase", "(", "\"\"", ")", ")", "{", "return", "new", "GetRangeSlicesForStateCity", "(", "tutorialKeyspace", ")", ";", "}", "else", "if", "(", "cmd", ".", "equalsIgnoreCase", "(", "\"\"", ")", ")", "{", "return", "new", "GetSliceForAreaCodeCity", "(", "tutorialKeyspace", ")", ";", "}", "else", "if", "(", "cmd", ".", "equalsIgnoreCase", "(", "\"get_slice_sc\"", ")", ")", "{", "return", "new", "GetSliceForStateCity", "(", "tutorialKeyspace", ")", ";", "}", "else", "if", "(", "cmd", ".", "equalsIgnoreCase", "(", "\"\"", ")", ")", "{", "return", "new", "MultigetSliceForNpanxx", "(", "tutorialKeyspace", ")", ";", "}", "else", "if", "(", "cmd", ".", "equalsIgnoreCase", "(", "\"\"", ")", ")", "{", "return", "new", "GetIndexedSlicesForCityState", "(", "tutorialKeyspace", ")", ";", "}", "else", "if", "(", "cmd", ".", "equalsIgnoreCase", "(", "\"\"", ")", ")", "{", "return", "new", "GetIndexedSlicesHandleRawBytes", "(", "tutorialKeyspace", ")", ";", "}", "else", "if", "(", "cmd", ".", "equalsIgnoreCase", "(", "\"insert\"", ")", ")", "{", "return", "new", "InsertRowsForColumnFamilies", "(", "tutorialKeyspace", ")", ";", "}", "else", "if", "(", "cmd", ".", "equalsIgnoreCase", "(", "\"delete\"", ")", ")", "{", "return", "new", "DeleteRowsForColumnFamily", "(", "tutorialKeyspace", ")", ";", "}", "else", "if", "(", "cmd", ".", "equalsIgnoreCase", "(", "\"get_hcol\"", ")", ")", "{", "return", "new", "GetNpanxxHColumnFamily", "(", "tutorialKeyspace", ")", ";", "}", "else", "if", "(", "cmd", ".", "equalsIgnoreCase", "(", "\"\"", ")", ")", "{", "return", "new", "StaticCompositeIndex", "(", "tutorialKeyspace", ")", ";", "}", "else", "if", "(", "cmd", ".", "equalsIgnoreCase", "(", "\"\"", ")", ")", "{", "return", "new", "DynamicCompositeIndex", "(", "tutorialKeyspace", ")", ";", "}", "log", ".", "error", "(", "\"\"", ",", "cmd", ")", ";", "return", "null", ";", "}", "}", "</s>" ]
9,996
[ "<s>", "package", "com", ".", "datastax", ".", "tutorial", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "Keyspace", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "beans", ".", "HColumn", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "factory", ".", "HFactory", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "query", ".", "ColumnQuery", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "query", ".", "QueryResult", ";", "public", "class", "GetCityForNpanxx", "extends", "TutorialCommand", "{", "public", "GetCityForNpanxx", "(", "Keyspace", "keyspace", ")", "{", "super", "(", "keyspace", ")", ";", "}", "@", "Override", "public", "QueryResult", "<", "HColumn", "<", "String", ",", "String", ">", ">", "execute", "(", ")", "{", "ColumnQuery", "<", "String", ",", "String", ",", "String", ">", "columnQuery", "=", "HFactory", ".", "createStringColumnQuery", "(", "keyspace", ")", ";", "columnQuery", ".", "setColumnFamily", "(", "\"Npanxx\"", ")", ";", "columnQuery", ".", "setKey", "(", "\"512204\"", ")", ";", "columnQuery", ".", "setName", "(", "\"city\"", ")", ";", "QueryResult", "<", "HColumn", "<", "String", ",", "String", ">", ">", "result", "=", "columnQuery", ".", "execute", "(", ")", ";", "return", "result", ";", "}", "}", "</s>" ]
9,997
[ "<s>", "package", "com", ".", "datastax", ".", "tutorial", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "concurrent", ".", "Callable", ";", "import", "java", ".", "util", ".", "concurrent", ".", "ExecutorService", ";", "import", "java", ".", "util", ".", "concurrent", ".", "Executors", ";", "import", "java", ".", "util", ".", "concurrent", ".", "Future", ";", "import", "me", ".", "prettyprint", ".", "cassandra", ".", "serializers", ".", "LongSerializer", ";", "import", "me", ".", "prettyprint", ".", "cassandra", ".", "serializers", ".", "StringSerializer", ";", "import", "me", ".", "prettyprint", ".", "cassandra", ".", "service", ".", "KeyIterator", ";", "import", "me", ".", "prettyprint", ".", "cassandra", ".", "utils", ".", "TimeUUIDUtils", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "beans", ".", "HColumn", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "factory", ".", "HFactory", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "mutation", ".", "Mutator", ";", "import", "org", ".", "apache", ".", "commons", ".", "lang", ".", "RandomStringUtils", ";", "import", "org", ".", "slf4j", ".", "Logger", ";", "import", "org", ".", "slf4j", ".", "LoggerFactory", ";", "public", "class", "KeyIteratorExample", "extends", "TutorialBase", "{", "private", "Logger", "log", "=", "LoggerFactory", ".", "getLogger", "(", "KeyIteratorExample", ".", "class", ")", ";", "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "long", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "init", "(", ")", ";", "ExecutorService", "exec", "=", "Executors", ".", "newFixedThreadPool", "(", "5", ")", ";", "List", "<", "Future", "<", "Integer", ">", ">", "futures", "=", "new", "ArrayList", "<", "Future", "<", "Integer", ">", ">", "(", ")", ";", "for", "(", "int", "x", "=", "0", ";", "x", "<", "50", ";", "x", "++", ")", "{", "futures", ".", "add", "(", "exec", ".", "submit", "(", "new", "KeyIteratorExample", "(", ")", ".", "new", "RowInserter", "(", ")", ")", ")", ";", "}", "int", "total", "=", "0", ";", "try", "{", "for", "(", "Future", "<", "Integer", ">", "f", ":", "futures", ")", "{", "total", "+=", "f", ".", "get", "(", ")", ".", "intValue", "(", ")", ";", "}", "}", "catch", "(", "Exception", "ex", ")", "{", "ex", ".", "printStackTrace", "(", ")", ";", "}", "int", "keyCount", "=", "0", ";", "KeyIterator", "<", "String", ">", "keyIterator", "=", "new", "KeyIterator", "<", "String", ">", "(", "tutorialKeyspace", ",", "\"\"", ",", "StringSerializer", ".", "get", "(", ")", ")", ";", "for", "(", "String", "key", ":", "keyIterator", ")", "{", "keyCount", "++", ";", "}", "System", ".", "out", ".", "printf", "(", "\"\"", ",", "keyCount", ")", ";", "exec", ".", "shutdown", "(", ")", ";", "}", "class", "RowInserter", "implements", "Callable", "<", "Integer", ">", "{", "public", "Integer", "call", "(", ")", "{", "Mutator", "<", "String", ">", "mutator", "=", "HFactory", ".", "createMutator", "(", "tutorialKeyspace", ",", "StringSerializer", ".", "get", "(", ")", ")", ";", "int", "count", "=", "0", ";", "String", "myKey", "=", "TimeUUIDUtils", ".", "getTimeUUID", "(", "tutorialKeyspace", ".", "createClock", "(", ")", ")", ".", "toString", "(", ")", ";", "for", "(", "int", "x", "=", "0", ";", "x", "<", "1000", ";", "x", "++", ")", "{", "mutator", ".", "addInsertion", "(", "myKey", ",", "\"\"", ",", "buildColumnFor", "(", "x", ")", ")", ";", "if", "(", "x", "%", "50", "==", "0", ")", "{", "myKey", "=", "TimeUUIDUtils", ".", "getTimeUUID", "(", "tutorialKeyspace", ".", "createClock", "(", ")", ")", ".", "toString", "(", ")", ";", "count", "++", ";", "}", "}", "mutator", ".", "execute", "(", ")", ";", "log", ".", "debug", "(", "\"\"", ",", "count", ")", ";", "return", "Integer", ".", "valueOf", "(", "count", ")", ";", "}", "}", "private", "HColumn", "<", "Long", ",", "String", ">", "buildColumnFor", "(", "int", "colName", ")", "{", "HColumn", "<", "Long", ",", "String", ">", "column", "=", "HFactory", ".", "createColumn", "(", "new", "Long", "(", "colName", ")", ",", "RandomStringUtils", ".", "randomAlphanumeric", "(", "32", ")", ",", "LongSerializer", ".", "get", "(", ")", ",", "StringSerializer", ".", "get", "(", ")", ")", ";", "return", "column", ";", "}", "}", "</s>" ]
9,998
[ "<s>", "package", "com", ".", "datastax", ".", "tutorial", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "util", ".", "Properties", ";", "import", "me", ".", "prettyprint", ".", "cassandra", ".", "model", ".", "ConfigurableConsistencyLevel", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "Cluster", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "HConsistencyLevel", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "Keyspace", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "factory", ".", "HFactory", ";", "public", "class", "TutorialBase", "{", "protected", "static", "Cluster", "tutorialCluster", ";", "protected", "static", "Keyspace", "tutorialKeyspace", ";", "protected", "static", "Properties", "properties", ";", "protected", "static", "void", "init", "(", ")", "{", "properties", "=", "new", "Properties", "(", ")", ";", "try", "{", "properties", ".", "load", "(", "TutorialBase", ".", "class", ".", "getResourceAsStream", "(", "\"\"", ")", ")", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "ioe", ".", "printStackTrace", "(", ")", ";", "}", "tutorialCluster", "=", "HFactory", ".", "getOrCreateCluster", "(", "properties", ".", "getProperty", "(", "\"cluster.name\"", ",", "\"\"", ")", ",", "properties", ".", "getProperty", "(", "\"\"", ",", "\"\"", ")", ")", ";", "ConfigurableConsistencyLevel", "ccl", "=", "new", "ConfigurableConsistencyLevel", "(", ")", ";", "ccl", ".", "setDefaultReadConsistencyLevel", "(", "HConsistencyLevel", ".", "ONE", ")", ";", "tutorialKeyspace", "=", "HFactory", ".", "createKeyspace", "(", "properties", ".", "getProperty", "(", "\"\"", ",", "\"Tutorial\"", ")", ",", "tutorialCluster", ",", "ccl", ")", ";", "}", "}", "</s>" ]
9,999
[ "<s>", "package", "com", ".", "datastax", ".", "tutorial", ";", "import", "me", ".", "prettyprint", ".", "cassandra", ".", "model", ".", "IndexedSlicesQuery", ";", "import", "me", ".", "prettyprint", ".", "cassandra", ".", "serializers", ".", "BytesArraySerializer", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "Keyspace", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "beans", ".", "OrderedRows", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "factory", ".", "HFactory", ";", "import", "me", ".", "prettyprint", ".", "hector", ".", "api", ".", "query", ".", "QueryResult", ";", "public", "class", "GetIndexedSlicesHandleRawBytes", "extends", "TutorialCommand", "{", "private", "static", "final", "BytesArraySerializer", "bas", "=", "BytesArraySerializer", ".", "get", "(", ")", ";", "public", "GetIndexedSlicesHandleRawBytes", "(", "Keyspace", "keyspace", ")", "{", "super", "(", "keyspace", ")", ";", "}", "@", "Override", "public", "QueryResult", "<", "OrderedRows", "<", "String", ",", "String", ",", "byte", "[", "]", ">", ">", "execute", "(", ")", "{", "IndexedSlicesQuery", "<", "String", ",", "String", ",", "byte", "[", "]", ">", "indexedSlicesQuery", "=", "HFactory", ".", "createIndexedSlicesQuery", "(", "keyspace", ",", "stringSerializer", ",", "stringSerializer", ",", "bas", ")", ";", "indexedSlicesQuery", ".", "setColumnFamily", "(", "\"Npanxx\"", ")", ";", "indexedSlicesQuery", ".", "setColumnNames", "(", "\"city\"", ",", "\"state\"", ",", "\"lat\"", ",", "\"lng\"", ")", ";", "indexedSlicesQuery", ".", "addEqualsExpression", "(", "\"state\"", ",", "stringSerializer", ".", "toBytes", "(", "\"TX\"", ")", ")", ";", "indexedSlicesQuery", ".", "addEqualsExpression", "(", "\"city\"", ",", "stringSerializer", ".", "toBytes", "(", "\"Austin\"", ")", ")", ";", "indexedSlicesQuery", ".", "addGteExpression", "(", "\"lat\"", ",", "stringSerializer", ".", "toBytes", "(", "\"30.30\"", ")", ")", ";", "QueryResult", "<", "OrderedRows", "<", "String", ",", "String", ",", "byte", "[", "]", ">", ">", "result", "=", "indexedSlicesQuery", ".", "execute", "(", ")", ";", "String", "city", "=", "stringSerializer", ".", "fromBytes", "(", "result", ".", "get", "(", ")", ".", "iterator", "(", ")", ".", "next", "(", ")", ".", "getColumnSlice", "(", ")", ".", "getColumnByName", "(", "\"city\"", ")", ".", "getValue", "(", ")", ")", ";", "log", ".", "info", "(", "\"\"", ",", "city", ",", "result", ".", "get", "(", ")", ".", "iterator", "(", ")", ".", "next", "(", ")", ".", "getColumnSlice", "(", ")", ".", "getColumnByName", "(", "\"city\"", ")", ".", "getValue", "(", ")", ")", ";", "return", "result", ";", "}", "}", "</s>" ]